diff --git a/include/boost/python/object/pointer_holder.hpp b/include/boost/python/object/pointer_holder.hpp index 94e239f1..c3bffa2c 100644 --- a/include/boost/python/object/pointer_holder.hpp +++ b/include/boost/python/object/pointer_holder.hpp @@ -14,7 +14,7 @@ # include # include # include -# include +# include # include # include @@ -56,7 +56,7 @@ template struct pointer_holder_back_reference : instance_holder { private: - typedef typename python::detail::pointee::type held_type; + typedef typename python::pointee::type held_type; public: pointer_holder_back_reference(Pointer); diff --git a/include/boost/python/object/select_holder.hpp b/include/boost/python/object/select_holder.hpp index 95330d10..b4e451c8 100644 --- a/include/boost/python/object/select_holder.hpp +++ b/include/boost/python/object/select_holder.hpp @@ -8,7 +8,7 @@ # include # include -# include +# include # include # include # include @@ -36,7 +36,7 @@ namespace detail template struct select_pointer_holder { - typedef typename python::detail::pointee::type pointee; + typedef typename python::pointee::type pointee; BOOST_STATIC_CONSTANT(bool, selector = (!is_same::value) | has_back_reference::value); typedef typename mpl::select_type< diff --git a/include/boost/python/pointee.hpp b/include/boost/python/pointee.hpp new file mode 100644 index 00000000..52d65d67 --- /dev/null +++ b/include/boost/python/pointee.hpp @@ -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 + +namespace boost { namespace python { + +namespace detail +{ + template + struct pointee_impl + { + template struct apply : remove_pointer {}; + }; + + template <> + struct pointee_impl + { + template struct apply + { + typedef typename T::element_type type; + }; + }; +} + +template +struct pointee + : detail::pointee_impl::value>::template apply +{ +}; + +}} // namespace boost::python::detail + +#endif // POINTEE_DWA2002323_HPP diff --git a/test/pointee.cpp b/test/pointee.cpp index 7935e897..44836b05 100644 --- a/test/pointee.cpp +++ b/test/pointee.cpp @@ -3,7 +3,7 @@ // 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. -#include +#include #include #include #include @@ -15,19 +15,19 @@ int main() { BOOST_STATIC_ASSERT( (boost::is_same< - boost::python::detail::pointee >::type + boost::python::pointee >::type , char** >::value)); BOOST_STATIC_ASSERT( (boost::is_same< - boost::python::detail::pointee >::type + boost::python::pointee >::type , A>::value)); #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION BOOST_STATIC_ASSERT( (boost::is_same< - boost::python::detail::pointee::type + boost::python::pointee::type , char >::value)); #endif