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/config.hpp"
13 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
15 # define BOOST_TT_BROKEN_COMPILER_SPEC(T) /**/
20 // forward declarations
21 template< typename T > struct remove_const;
22 template< typename T > struct remove_volatile;
23 template< typename T > struct remove_cv;
24 template< typename T > struct remove_pointer;
25 template< typename T > struct remove_reference;
28 // same as BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1 macro, except that it
29 // never gets #undef-ined
30 # define BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(trait,spec,result) \
31 template<> struct trait<spec> \
33 typedef result type; \
37 # define BOOST_TT_AUX_REMOVE_CONST_VOLATILE_RANK1_SPEC(T) \
38 BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_const,T const,T) \
39 BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_const,T const volatile,T volatile) \
40 BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_volatile,T volatile,T) \
41 BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_volatile,T const volatile,T const) \
42 BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_cv,T const,T) \
43 BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_cv,T volatile,T) \
44 BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_cv,T const volatile,T) \
47 # define BOOST_TT_AUX_REMOVE_PTR_REF_RANK_1_SPEC(T) \
48 BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_pointer,T*,T) \
49 BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_reference,T&,T) \
52 # define BOOST_TT_AUX_REMOVE_PTR_REF_RANK_2_SPEC(T) \
53 BOOST_TT_AUX_REMOVE_PTR_REF_RANK_1_SPEC(T) \
54 BOOST_TT_AUX_REMOVE_PTR_REF_RANK_1_SPEC(T const) \
55 BOOST_TT_AUX_REMOVE_PTR_REF_RANK_1_SPEC(T volatile) \
56 BOOST_TT_AUX_REMOVE_PTR_REF_RANK_1_SPEC(T const volatile) \
59 # define BOOST_TT_AUX_REMOVE_ALL_RANK_1_SPEC(T) \
60 BOOST_TT_AUX_REMOVE_PTR_REF_RANK_2_SPEC(T) \
61 BOOST_TT_AUX_REMOVE_CONST_VOLATILE_RANK1_SPEC(T) \
64 # define BOOST_TT_AUX_REMOVE_ALL_RANK_2_SPEC(T) \
65 BOOST_TT_AUX_REMOVE_ALL_RANK_1_SPEC(T*) \
66 BOOST_TT_AUX_REMOVE_ALL_RANK_1_SPEC(T const*) \
67 BOOST_TT_AUX_REMOVE_ALL_RANK_1_SPEC(T volatile*) \
68 BOOST_TT_AUX_REMOVE_ALL_RANK_1_SPEC(T const volatile*) \
71 # define BOOST_TT_BROKEN_COMPILER_SPEC(T) \
73 BOOST_TT_AUX_REMOVE_ALL_RANK_1_SPEC(T) \
74 BOOST_TT_AUX_REMOVE_ALL_RANK_2_SPEC(T) \
75 BOOST_TT_AUX_REMOVE_ALL_RANK_2_SPEC(T*) \
76 BOOST_TT_AUX_REMOVE_ALL_RANK_2_SPEC(T const*) \
77 BOOST_TT_AUX_REMOVE_ALL_RANK_2_SPEC(T volatile*) \
78 BOOST_TT_AUX_REMOVE_ALL_RANK_2_SPEC(T const volatile*) \
82 # include "boost/type_traits/detail/type_trait_undef.hpp"
84 #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
86 BOOST_TT_BROKEN_COMPILER_SPEC(bool)
87 BOOST_TT_BROKEN_COMPILER_SPEC(char)
88 #ifndef BOOST_NO_INTRINSIC_WCHAR_T
89 BOOST_TT_BROKEN_COMPILER_SPEC(wchar_t)
91 BOOST_TT_BROKEN_COMPILER_SPEC(signed char)
92 BOOST_TT_BROKEN_COMPILER_SPEC(unsigned char)
93 BOOST_TT_BROKEN_COMPILER_SPEC(signed short)
94 BOOST_TT_BROKEN_COMPILER_SPEC(unsigned short)
95 BOOST_TT_BROKEN_COMPILER_SPEC(signed int)
96 BOOST_TT_BROKEN_COMPILER_SPEC(unsigned int)
97 BOOST_TT_BROKEN_COMPILER_SPEC(signed long)
98 BOOST_TT_BROKEN_COMPILER_SPEC(unsigned long)
99 BOOST_TT_BROKEN_COMPILER_SPEC(float)
100 BOOST_TT_BROKEN_COMPILER_SPEC(double)
101 BOOST_TT_BROKEN_COMPILER_SPEC(long double)
103 // for backward compatibility
104 #define BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(T) \
105 BOOST_TT_BROKEN_COMPILER_SPEC(T) \
108 #endif // BOOST_TT_BROKEN_COMPILER_SPEC_HPP_INCLUDED