diff options
Diffstat (limited to 'boost/python/object')
-rw-r--r-- | boost/python/object/class_metadata.hpp | 36 | ||||
-rw-r--r-- | boost/python/object/forward.hpp | 11 | ||||
-rw-r--r-- | boost/python/object/inheritance.hpp | 7 | ||||
-rw-r--r-- | boost/python/object/instance.hpp | 6 | ||||
-rw-r--r-- | boost/python/object/iterator.hpp | 9 | ||||
-rw-r--r-- | boost/python/object/make_instance.hpp | 5 | ||||
-rw-r--r-- | boost/python/object/make_ptr_instance.hpp | 8 | ||||
-rw-r--r-- | boost/python/object/pointer_holder.hpp | 5 |
8 files changed, 38 insertions, 49 deletions
diff --git a/boost/python/object/class_metadata.hpp b/boost/python/object/class_metadata.hpp index 8e750b85cf..93303ecb60 100644 --- a/boost/python/object/class_metadata.hpp +++ b/boost/python/object/class_metadata.hpp @@ -17,14 +17,11 @@ #include <boost/python/detail/force_instantiate.hpp> #include <boost/python/detail/not_specified.hpp> +#include <boost/python/detail/type_traits.hpp> #include <boost/python/has_back_reference.hpp> #include <boost/python/bases.hpp> -#include <boost/type_traits/add_pointer.hpp> -#include <boost/type_traits/is_convertible.hpp> -#include <boost/type_traits/is_polymorphic.hpp> - #include <boost/mpl/if.hpp> #include <boost/mpl/eval_if.hpp> #include <boost/mpl/bool.hpp> @@ -35,9 +32,6 @@ #include <boost/mpl/single_view.hpp> #include <boost/mpl/assert.hpp> -#include <boost/type_traits/is_same.hpp> - -#include <boost/type_traits/is_convertible.hpp> #include <boost/noncopyable.hpp> #include <boost/detail/workaround.hpp> @@ -56,7 +50,7 @@ struct register_base_of template <class Base> inline void operator()(Base*) const { - BOOST_MPL_ASSERT_NOT((is_same<Base,Derived>)); + BOOST_MPL_ASSERT_NOT((boost::python::detail::is_same<Base,Derived>)); // Register the Base class register_dynamic_id<Base>(); @@ -65,14 +59,14 @@ struct register_base_of register_conversion<Derived,Base>(false); // Register the down-cast, if appropriate. - this->register_downcast((Base*)0, is_polymorphic<Base>()); + this->register_downcast((Base*)0, boost::python::detail::is_polymorphic<Base>()); } private: - static inline void register_downcast(void*, mpl::false_) {} + static inline void register_downcast(void*, boost::python::detail::false_) {} template <class Base> - static inline void register_downcast(Base*, mpl::true_) + static inline void register_downcast(Base*, boost::python::detail::true_) { register_conversion<Base, Derived>(true); } @@ -98,7 +92,7 @@ inline void register_shared_ptr_from_python_and_casts(T*, Bases) // interface to mpl::for_each to avoid an MSVC 6 bug. // register_dynamic_id<T>(); - mpl::for_each(register_base_of<T>(), (Bases*)0, (add_pointer<mpl::_>*)0); + mpl::for_each(register_base_of<T>(), (Bases*)0, (boost::python::detail::add_pointer<mpl::_>*)0); } // @@ -109,7 +103,7 @@ struct select_held_type : mpl::if_< mpl::or_< python::detail::specifies_bases<T> - , is_same<T,noncopyable> + , boost::python::detail::is_same<T,noncopyable> > , Prev , T @@ -156,9 +150,9 @@ struct class_metadata >::type bases; typedef mpl::or_< - is_same<X1,noncopyable> - , is_same<X2,noncopyable> - , is_same<X3,noncopyable> + boost::python::detail::is_same<X1,noncopyable> + , boost::python::detail::is_same<X2,noncopyable> + , boost::python::detail::is_same<X3,noncopyable> > is_noncopyable; // @@ -167,11 +161,11 @@ struct class_metadata // Compute the actual type that will be held in the Holder. typedef typename mpl::if_< - is_same<held_type_arg,python::detail::not_specified>, T, held_type_arg + boost::python::detail::is_same<held_type_arg,python::detail::not_specified>, T, held_type_arg >::type held_type; // Determine if the object will be held by value - typedef mpl::bool_<is_convertible<held_type*,T*>::value> use_value_holder; + typedef mpl::bool_<boost::python::detail::is_convertible<held_type*,T*>::value> use_value_holder; // Compute the "wrapped type", that is, if held_type is a smart // pointer, we're talking about the pointee. @@ -185,7 +179,7 @@ struct class_metadata typedef mpl::bool_< mpl::or_< has_back_reference<T> - , is_same<held_type_arg,T> + , boost::python::detail::is_same<held_type_arg,T> , is_base_and_derived<T,wrapped> >::value > use_back_reference; @@ -214,7 +208,7 @@ struct class_metadata template <class T2> inline static void register_aux(python::wrapper<T2>*) { - typedef typename mpl::not_<is_same<T2,wrapped> >::type use_callback; + typedef typename mpl::not_<boost::python::detail::is_same<T2,wrapped> >::type use_callback; class_metadata::register_aux2((T2*)0, use_callback()); } @@ -243,7 +237,7 @@ struct class_metadata inline static void maybe_register_pointer_to_python(...) {} #ifndef BOOST_PYTHON_NO_PY_SIGNATURES - inline static void maybe_register_pointer_to_python(void*,void*,mpl::true_*) + inline static void maybe_register_pointer_to_python(void*,void*,mpl::true_*) { objects::copy_class_object(python::type_id<T>(), python::type_id<back_reference<T const &> >()); objects::copy_class_object(python::type_id<T>(), python::type_id<back_reference<T &> >()); diff --git a/boost/python/object/forward.hpp b/boost/python/object/forward.hpp index 30613d8ebd..c6515bb55b 100644 --- a/boost/python/object/forward.hpp +++ b/boost/python/object/forward.hpp @@ -6,11 +6,9 @@ # define FORWARD_DWA20011215_HPP # include <boost/mpl/if.hpp> -# include <boost/type_traits/is_scalar.hpp> -# include <boost/type_traits/add_const.hpp> -# include <boost/type_traits/add_reference.hpp> # include <boost/ref.hpp> # include <boost/python/detail/value_arg.hpp> +# include <boost/python/detail/type_traits.hpp> # include <boost/python/detail/copy_ctor_mutates_rhs.hpp> # include <boost/mpl/or.hpp> @@ -22,7 +20,8 @@ namespace boost { namespace python { namespace objects { template <class T> struct reference_to_value { - typedef typename add_reference<typename add_const<T>::type>::type reference; + typedef typename boost::python::detail::add_lvalue_reference<typename + boost::python::detail::add_const<T>::type>::type reference; reference_to_value(reference x) : m_value(x) {} reference get() const { return m_value; } @@ -36,7 +35,7 @@ struct reference_to_value template <class T> struct forward : mpl::if_< - mpl::or_<python::detail::copy_ctor_mutates_rhs<T>, is_scalar<T> > + mpl::or_<python::detail::copy_ctor_mutates_rhs<T>, boost::python::detail::is_scalar<T> > , T , reference_to_value<T> > @@ -65,7 +64,7 @@ struct unforward_cref template<typename T> struct unforward_cref<reference_to_value<T> > - : add_reference<typename add_const<T>::type> + : boost::python::detail::add_lvalue_reference<typename boost::python::detail::add_const<T>::type> { }; diff --git a/boost/python/object/inheritance.hpp b/boost/python/object/inheritance.hpp index b49a0442e2..90e56f0c1d 100644 --- a/boost/python/object/inheritance.hpp +++ b/boost/python/object/inheritance.hpp @@ -8,9 +8,8 @@ # include <boost/python/type_id.hpp> # include <boost/shared_ptr.hpp> # include <boost/mpl/if.hpp> -# include <boost/type_traits/is_polymorphic.hpp> -# include <boost/type_traits/is_base_and_derived.hpp> # include <boost/detail/workaround.hpp> +# include <boost/python/detail/type_traits.hpp> namespace boost { namespace python { namespace objects { @@ -58,7 +57,7 @@ struct non_polymorphic_id_generator template <class T> struct dynamic_id_generator : mpl::if_< - boost::is_polymorphic<T> + boost::python::detail::is_polymorphic<T> , boost::python::objects::polymorphic_id_generator<T> , boost::python::objects::non_polymorphic_id_generator<T> > @@ -104,7 +103,7 @@ struct implicit_cast_generator template <class Source, class Target> struct cast_generator : mpl::if_< - is_base_and_derived<Target,Source> + boost::python::detail::is_base_and_derived<Target,Source> , implicit_cast_generator<Source,Target> , dynamic_cast_generator<Source,Target> > diff --git a/boost/python/object/instance.hpp b/boost/python/object/instance.hpp index 9c28d6822d..27b91a1e5f 100644 --- a/boost/python/object/instance.hpp +++ b/boost/python/object/instance.hpp @@ -6,7 +6,7 @@ # define INSTANCE_DWA200295_HPP # include <boost/python/detail/prefix.hpp> -# include <boost/type_traits/alignment_traits.hpp> + # include <cstddef> namespace boost { namespace python @@ -25,8 +25,8 @@ struct instance PyObject* weakrefs; instance_holder* objects; - typedef typename type_with_alignment< - ::boost::alignment_of<Data>::value + typedef typename boost::python::detail::type_with_alignment< + boost::python::detail::alignment_of<Data>::value >::type align_t; union diff --git a/boost/python/object/iterator.hpp b/boost/python/object/iterator.hpp index db5224713f..e2f65721fb 100644 --- a/boost/python/object/iterator.hpp +++ b/boost/python/object/iterator.hpp @@ -6,6 +6,7 @@ # define ITERATOR_DWA2002510_HPP # include <boost/python/detail/prefix.hpp> +# include <boost/python/detail/type_traits.hpp> # include <boost/python/class.hpp> # include <boost/python/return_value_policy.hpp> @@ -24,10 +25,6 @@ # include <boost/type.hpp> -# include <boost/type_traits/is_same.hpp> -# include <boost/type_traits/add_reference.hpp> -# include <boost/type_traits/add_const.hpp> - # include <boost/detail/iterator.hpp> namespace boost { namespace python { namespace objects { @@ -202,8 +199,8 @@ inline object make_iterator_function( ) { typedef typename Accessor1::result_type iterator; - typedef typename add_const<iterator>::type iterator_const; - typedef typename add_reference<iterator_const>::type iterator_cref; + typedef typename boost::python::detail::add_const<iterator>::type iterator_const; + typedef typename boost::python::detail::add_lvalue_reference<iterator_const>::type iterator_cref; return detail::make_iterator_function( get_start diff --git a/boost/python/object/make_instance.hpp b/boost/python/object/make_instance.hpp index 5f2630adc7..31ec08f7c3 100644 --- a/boost/python/object/make_instance.hpp +++ b/boost/python/object/make_instance.hpp @@ -9,10 +9,10 @@ # include <boost/python/object/instance.hpp> # include <boost/python/converter/registered.hpp> # include <boost/python/detail/decref_guard.hpp> +# include <boost/python/detail/type_traits.hpp> # include <boost/python/detail/none.hpp> # include <boost/mpl/assert.hpp> # include <boost/mpl/or.hpp> -# include <boost/type_traits/is_union.hpp> namespace boost { namespace python { namespace objects { @@ -24,7 +24,8 @@ struct make_instance_impl template <class Arg> static inline PyObject* execute(Arg& x) { - BOOST_MPL_ASSERT((mpl::or_<is_class<T>, is_union<T> >)); + BOOST_MPL_ASSERT((mpl::or_<boost::python::detail::is_class<T>, + boost::python::detail::is_union<T> >)); PyTypeObject* type = Derived::get_class_object(x); diff --git a/boost/python/object/make_ptr_instance.hpp b/boost/python/object/make_ptr_instance.hpp index 3a28190293..21089c6b88 100644 --- a/boost/python/object/make_ptr_instance.hpp +++ b/boost/python/object/make_ptr_instance.hpp @@ -7,7 +7,7 @@ # include <boost/python/object/make_instance.hpp> # include <boost/python/converter/registry.hpp> -# include <boost/type_traits/is_polymorphic.hpp> +# include <boost/python/detail/type_traits.hpp> # include <boost/get_pointer.hpp> # include <boost/detail/workaround.hpp> # include <typeinfo> @@ -47,7 +47,7 @@ struct make_ptr_instance return 0; // means "return None". PyTypeObject* derived = get_derived_class_object( - BOOST_DEDUCED_TYPENAME is_polymorphic<U>::type(), p); + BOOST_DEDUCED_TYPENAME boost::python::detail::is_polymorphic<U>::type(), p); if (derived) return derived; @@ -55,7 +55,7 @@ struct make_ptr_instance } template <class U> - static inline PyTypeObject* get_derived_class_object(mpl::true_, U const volatile* x) + static inline PyTypeObject* get_derived_class_object(boost::python::detail::true_, U const volatile* x) { converter::registration const* r = converter::registry::query( type_info(typeid(*get_pointer(x))) @@ -64,7 +64,7 @@ struct make_ptr_instance } template <class U> - static inline PyTypeObject* get_derived_class_object(mpl::false_, U*) + static inline PyTypeObject* get_derived_class_object(boost::python::detail::false_, U*) { return 0; } diff --git a/boost/python/object/pointer_holder.hpp b/boost/python/object/pointer_holder.hpp index b28cbd83c8..c5caefe62c 100644 --- a/boost/python/object/pointer_holder.hpp +++ b/boost/python/object/pointer_holder.hpp @@ -21,6 +21,7 @@ # include <boost/python/detail/wrapper_base.hpp> # include <boost/python/detail/force_instantiate.hpp> # include <boost/python/detail/preprocessor.hpp> +# include <boost/python/detail/type_traits.hpp> # include <boost/mpl/if.hpp> @@ -35,8 +36,6 @@ # include <boost/detail/workaround.hpp> -# include <boost/type_traits/remove_const.hpp> - namespace boost { namespace python { template <class T> class wrapper; @@ -128,7 +127,7 @@ inline pointer_holder_back_reference<Pointer,Value>::pointer_holder_back_referen template <class Pointer, class Value> void* pointer_holder<Pointer, Value>::holds(type_info dst_t, bool null_ptr_only) { - typedef typename boost::remove_const< Value >::type non_const_value; + typedef typename boost::python::detail::remove_const< Value >::type non_const_value; if (dst_t == python::type_id<Pointer>() && !(null_ptr_only && get_pointer(this->m_p)) |