2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-23 05:42:30 +00:00

Moved pointee up from detail

[SVN r13810]
This commit is contained in:
Dave Abrahams
2002-05-10 15:47:59 +00:00
parent 710374ed1e
commit 63deae3ab2
4 changed files with 47 additions and 8 deletions

View File

@@ -14,7 +14,7 @@
# include <boost/type.hpp>
# include <boost/mpl/select_type.hpp>
# include <boost/mpl/apply.hpp>
# include <boost/python/detail/pointee.hpp>
# include <boost/python/pointee.hpp>
# include <boost/python/detail/preprocessor.hpp>
# include <boost/preprocessor/enum_params.hpp>
@@ -56,7 +56,7 @@ template <class Pointer, class Value>
struct pointer_holder_back_reference : instance_holder
{
private:
typedef typename python::detail::pointee<Pointer>::type held_type;
typedef typename python::pointee<Pointer>::type held_type;
public:
pointer_holder_back_reference(Pointer);

View File

@@ -8,7 +8,7 @@
# include <boost/python/has_back_reference.hpp>
# include <boost/python/detail/not_specified.hpp>
# include <boost/python/detail/pointee.hpp>
# include <boost/python/pointee.hpp>
# include <boost/python/object/value_holder.hpp>
# include <boost/python/object/pointer_holder.hpp>
# include <boost/type.hpp>
@@ -36,7 +36,7 @@ namespace detail
template <class T,class Ptr>
struct select_pointer_holder
{
typedef typename python::detail::pointee<Ptr>::type pointee;
typedef typename python::pointee<Ptr>::type pointee;
BOOST_STATIC_CONSTANT(bool, selector = (!is_same<T,pointee>::value) | has_back_reference<T>::value);
typedef typename mpl::select_type<

View File

@@ -0,0 +1,39 @@
// Copyright David Abrahams 2002. Permission to copy, use,
// modify, sell and distribute this software is granted provided this
// copyright notice appears in all copies. This software is provided
// "as is" without express or implied warranty, and with no claim as
// to its suitability for any purpose.
#ifndef POINTEE_DWA2002323_HPP
# define POINTEE_DWA2002323_HPP
# include <boost/type_traits/object_traits.hpp>
namespace boost { namespace python {
namespace detail
{
template <bool is_ptr = true>
struct pointee_impl
{
template <class T> struct apply : remove_pointer<T> {};
};
template <>
struct pointee_impl<false>
{
template <class T> struct apply
{
typedef typename T::element_type type;
};
};
}
template <class T>
struct pointee
: detail::pointee_impl<is_pointer<T>::value>::template apply<T>
{
};
}} // namespace boost::python::detail
#endif // POINTEE_DWA2002323_HPP