2 // (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes,
3 // Howard Hinnant and John Maddock 2000.
4 // (C) Copyright Mat Marcus, Jesse Jones and Adobe Systems Inc 2001
6 // Use, modification and distribution are subject to the Boost Software License,
7 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
8 // http://www.boost.org/LICENSE_1_0.txt).
10 // See http://www.boost.org/libs/type_traits for most recent version including documentation.
12 // Fixed is_pointer, is_reference, is_const, is_volatile, is_same,
13 // is_member_pointer based on the Simulated Partial Specialization work
14 // of Mat Marcus and Jesse Jones. See http://opensource.adobe.com or
15 // http://groups.yahoo.com/group/boost/message/5441
16 // Some workarounds in here use ideas suggested from "Generic<Programming>:
17 // Mappings between Types and Values"
18 // by Andrei Alexandrescu (see http://www.cuj.com/experts/1810/alexandr.html).
21 #ifndef BOOST_TT_IS_POINTER_HPP_INCLUDED
22 #define BOOST_TT_IS_POINTER_HPP_INCLUDED
24 #include <boost/type_traits/is_member_pointer.hpp>
25 #include <boost/type_traits/detail/ice_and.hpp>
26 #include <boost/type_traits/detail/ice_not.hpp>
27 #include <boost/type_traits/config.hpp>
28 #include <boost/type_traits/remove_cv.hpp>
31 // should be the last #include
32 #include <boost/type_traits/detail/bool_trait_def.hpp>
36 #if defined( __CODEGEARC__ )
37 BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_pointer,T,__is_pointer(T))
42 template< typename T > struct is_pointer_helper
44 BOOST_STATIC_CONSTANT(bool, value = false);
47 # define TT_AUX_BOOL_TRAIT_HELPER_PARTIAL_SPEC(helper,sp,result) \
48 template< typename T > struct helper<sp> \
50 BOOST_STATIC_CONSTANT(bool, value = result); \
54 TT_AUX_BOOL_TRAIT_HELPER_PARTIAL_SPEC(is_pointer_helper,T*,true)
56 # undef TT_AUX_BOOL_TRAIT_HELPER_PARTIAL_SPEC
58 template< typename T >
59 struct is_pointer_impl
61 BOOST_STATIC_CONSTANT(bool, value =
62 (::boost::type_traits::ice_and<
63 ::boost::detail::is_pointer_helper<typename remove_cv<T>::type>::value
64 , ::boost::type_traits::ice_not<
65 ::boost::is_member_pointer<T>::value
73 BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_pointer,T,::boost::detail::is_pointer_impl<T>::value)
75 #if defined(__BORLANDC__) && !defined(__COMO__) && (__BORLANDC__ < 0x600)
76 BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_pointer,T&,false)
77 BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_pointer,T& const,false)
78 BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_pointer,T& volatile,false)
79 BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_pointer,T& const volatile,false)
86 #include <boost/type_traits/detail/bool_trait_undef.hpp>
88 #endif // BOOST_TT_IS_POINTER_HPP_INCLUDED