2 // Copyright (c) 2001 Aleksey Gurtovoy.
3 // Permission to copy, use, modify, sell and distribute this software is
4 // granted provided this copyright notice appears in all copies.
5 // This software is provided "as is" without express or implied warranty,
6 // and with no claim as to its suitability for any purpose.
8 #ifndef BOOST_TT_BROKEN_COMPILER_SPEC_HPP_INCLUDED
9 #define BOOST_TT_BROKEN_COMPILER_SPEC_HPP_INCLUDED
11 #include "boost/mpl/aux_/lambda_support.hpp"
12 #include "boost/config.hpp"
14 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
16 # define BOOST_TT_BROKEN_COMPILER_SPEC(T) /**/
20 namespace boost { namespace detail {
21 template< typename T > struct remove_const_impl { typedef T type; };
22 template< typename T > struct remove_volatile_impl { typedef T type; };
23 template< typename T > struct remove_pointer_impl { typedef T type; };
24 template< typename T > struct remove_reference_impl { typedef T type; };
27 // same as BOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1 macro, except that it
28 // never gets #undef-ined
29 # define BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(trait,spec,result) \
30 template<> struct trait##_impl<spec> \
32 typedef result type; \
36 # define BOOST_TT_AUX_REMOVE_CONST_VOLATILE_RANK1_SPEC(T) \
37 BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_const,T const,T) \
38 BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_const,T const volatile,T volatile) \
39 BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_volatile,T volatile,T) \
40 BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_volatile,T const volatile,T const) \
43 # define BOOST_TT_AUX_REMOVE_PTR_REF_RANK_1_SPEC(T) \
44 BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_pointer,T*,T) \
45 BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_reference,T&,T) \
48 # define BOOST_TT_AUX_REMOVE_PTR_REF_RANK_2_SPEC(T) \
49 BOOST_TT_AUX_REMOVE_PTR_REF_RANK_1_SPEC(T) \
50 BOOST_TT_AUX_REMOVE_PTR_REF_RANK_1_SPEC(T const) \
51 BOOST_TT_AUX_REMOVE_PTR_REF_RANK_1_SPEC(T volatile) \
52 BOOST_TT_AUX_REMOVE_PTR_REF_RANK_1_SPEC(T const volatile) \
55 # define BOOST_TT_AUX_REMOVE_ALL_RANK_1_SPEC(T) \
56 BOOST_TT_AUX_REMOVE_PTR_REF_RANK_2_SPEC(T) \
57 BOOST_TT_AUX_REMOVE_CONST_VOLATILE_RANK1_SPEC(T) \
60 # define BOOST_TT_AUX_REMOVE_ALL_RANK_2_SPEC(T) \
61 BOOST_TT_AUX_REMOVE_ALL_RANK_1_SPEC(T*) \
62 BOOST_TT_AUX_REMOVE_ALL_RANK_1_SPEC(T const*) \
63 BOOST_TT_AUX_REMOVE_ALL_RANK_1_SPEC(T volatile*) \
64 BOOST_TT_AUX_REMOVE_ALL_RANK_1_SPEC(T const volatile*) \
67 # define BOOST_TT_BROKEN_COMPILER_SPEC(T) \
68 namespace boost { namespace detail { \
69 BOOST_TT_AUX_REMOVE_ALL_RANK_1_SPEC(T) \
70 BOOST_TT_AUX_REMOVE_ALL_RANK_2_SPEC(T) \
71 BOOST_TT_AUX_REMOVE_ALL_RANK_2_SPEC(T*) \
72 BOOST_TT_AUX_REMOVE_ALL_RANK_2_SPEC(T const*) \
73 BOOST_TT_AUX_REMOVE_ALL_RANK_2_SPEC(T volatile*) \
74 BOOST_TT_AUX_REMOVE_ALL_RANK_2_SPEC(T const volatile*) \
78 # include "boost/type_traits/detail/type_trait_undef.hpp"
80 #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
82 BOOST_TT_BROKEN_COMPILER_SPEC(bool)
83 BOOST_TT_BROKEN_COMPILER_SPEC(char)
84 #ifndef BOOST_NO_INTRINSIC_WCHAR_T
85 BOOST_TT_BROKEN_COMPILER_SPEC(wchar_t)
87 BOOST_TT_BROKEN_COMPILER_SPEC(signed char)
88 BOOST_TT_BROKEN_COMPILER_SPEC(unsigned char)
89 BOOST_TT_BROKEN_COMPILER_SPEC(signed short)
90 BOOST_TT_BROKEN_COMPILER_SPEC(unsigned short)
91 BOOST_TT_BROKEN_COMPILER_SPEC(signed int)
92 BOOST_TT_BROKEN_COMPILER_SPEC(unsigned int)
93 BOOST_TT_BROKEN_COMPILER_SPEC(signed long)
94 BOOST_TT_BROKEN_COMPILER_SPEC(unsigned long)
95 BOOST_TT_BROKEN_COMPILER_SPEC(float)
96 BOOST_TT_BROKEN_COMPILER_SPEC(double)
97 //BOOST_TT_BROKEN_COMPILER_SPEC(long double)
99 // for backward compatibility
100 #define BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(T) \
101 BOOST_TT_BROKEN_COMPILER_SPEC(T) \
104 #endif // BOOST_TT_BROKEN_COMPILER_SPEC_HPP_INCLUDED