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_TRANSFORM_TRAITS_SPEC_HPP
9 #define BOOST_TT_TRANSFORM_TRAITS_SPEC_HPP
11 #ifndef TRANSFORM_TRAITS_HPP
12 #include <boost/type_traits/transform_traits.hpp>
15 #define BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_CONST_VOLATILE_RANK1(T) \
16 template<> struct remove_const<T const> { typedef T type; }; \
17 template<> struct remove_const<T const volatile> { typedef T volatile type; }; \
18 template<> struct remove_volatile<T volatile> { typedef T type; }; \
19 template<> struct remove_volatile<T const volatile> { typedef T const type; }; \
20 template<> struct remove_cv<T const> { typedef T type; }; \
21 template<> struct remove_cv<T volatile> { typedef T type; }; \
22 template<> struct remove_cv<T const volatile> { typedef T type; }; \
25 #define BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_PTR_REF_RANK_1(T) \
26 template<> struct remove_pointer<T*> { typedef T type; }; \
27 template<> struct remove_reference<T&> { typedef T type; }; \
30 #define BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_PTR_REF_RANK_2(T) \
31 BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_PTR_REF_RANK_1(T) \
32 BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_PTR_REF_RANK_1(T const) \
33 BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_PTR_REF_RANK_1(T volatile) \
34 BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_PTR_REF_RANK_1(T const volatile) \
37 #define BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_ALL_RANK_1(T) \
38 BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_PTR_REF_RANK_2(T) \
39 BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_CONST_VOLATILE_RANK1(T) \
42 #define BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_ALL_RANK_2(T) \
43 BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_ALL_RANK_1(T*) \
44 BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_ALL_RANK_1(T const*) \
45 BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_ALL_RANK_1(T volatile*) \
46 BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_ALL_RANK_1(T const volatile*) \
49 #define BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(T) \
51 BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_ALL_RANK_1(T) \
52 BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_ALL_RANK_2(T) \
53 BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_ALL_RANK_2(T*) \
54 BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_ALL_RANK_2(T const*) \
55 BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_ALL_RANK_2(T volatile*) \
56 BOOST_TYPE_TRAITS_SPECIALIZATION_REMOVE_ALL_RANK_2(T const volatile*) \
60 BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(bool)
61 BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(char)
62 #ifndef BOOST_NO_INTRINSIC_WCHAR_T
63 BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(wchar_t)
65 BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(signed char)
66 BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(unsigned char)
67 BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(signed short)
68 BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(unsigned short)
69 BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(signed int)
70 BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(unsigned int)
71 BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(signed long)
72 BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(unsigned long)
73 BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(float)
74 BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(double)
75 BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(long double)
77 #endif // BOOST_TT_TRANSFORM_TRAITS_SPEC_HPP