Fix cv qualified pointer types so they are recognised as pointers.

[SVN r36306]
This commit is contained in:
John Maddock
2006-12-09 09:33:22 +00:00
parent f26b33201b
commit 51dda56abd
3 changed files with 19 additions and 4 deletions

View File

@ -22,6 +22,7 @@
// version does not do so.
//
# include <boost/type_traits/detail/is_mem_fun_pointer_impl.hpp>
# include <boost/type_traits/remove_cv.hpp>
#else
# include <boost/type_traits/is_reference.hpp>
# include <boost/type_traits/is_array.hpp>
@ -41,7 +42,7 @@ namespace boost {
BOOST_TT_AUX_BOOL_TRAIT_DEF1(
is_member_function_pointer
, T
, ::boost::type_traits::is_mem_fun_pointer_impl<T>::value
, ::boost::type_traits::is_mem_fun_pointer_impl<typename remove_cv<T>::type>::value
)
#else

View File

@ -47,6 +47,9 @@ BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,
#elif !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_member_pointer,T,::boost::is_member_function_pointer<T>::value)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*,true)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*const,true)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*volatile,true)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,typename U,is_member_pointer,U T::*const volatile,true)
#else // no partial template specialization

View File

@ -25,6 +25,9 @@
#include <boost/type_traits/detail/ice_and.hpp>
#include <boost/type_traits/detail/ice_not.hpp>
#include <boost/type_traits/config.hpp>
#if !BOOST_WORKAROUND(BOOST_MSVC,<=1300)
#include <boost/type_traits/remove_cv.hpp>
#endif
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
# include <boost/type_traits/is_reference.hpp>
@ -56,15 +59,13 @@ template< typename T > struct helper<sp> \
/**/
TT_AUX_BOOL_TRAIT_HELPER_PARTIAL_SPEC(is_pointer_helper,T*,true)
TT_AUX_BOOL_TRAIT_HELPER_PARTIAL_SPEC(is_pointer_helper,T* const,true)
TT_AUX_BOOL_TRAIT_HELPER_PARTIAL_SPEC(is_pointer_helper,T* volatile,true)
TT_AUX_BOOL_TRAIT_HELPER_PARTIAL_SPEC(is_pointer_helper,T* const volatile,true)
# undef TT_AUX_BOOL_TRAIT_HELPER_PARTIAL_SPEC
template< typename T >
struct is_pointer_impl
{
#if BOOST_WORKAROUND(BOOST_MSVC,<=1300)
BOOST_STATIC_CONSTANT(bool, value =
(::boost::type_traits::ice_and<
::boost::detail::is_pointer_helper<T>::value
@ -73,6 +74,16 @@ struct is_pointer_impl
>::value
>::value)
);
#else
BOOST_STATIC_CONSTANT(bool, value =
(::boost::type_traits::ice_and<
::boost::detail::is_pointer_helper<typename remove_cv<T>::type>::value
, ::boost::type_traits::ice_not<
::boost::is_member_pointer<T>::value
>::value
>::value)
);
#endif
};
} // namespace detail