]> git.lyx.org Git - lyx.git/blob - boost/boost/type_traits/broken_compiler_spec.hpp
update boost to version 1.29.0
[lyx.git] / boost / boost / type_traits / broken_compiler_spec.hpp
1
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.
7
8 #ifndef BOOST_TT_BROKEN_COMPILER_SPEC_HPP_INCLUDED
9 #define BOOST_TT_BROKEN_COMPILER_SPEC_HPP_INCLUDED
10
11 #include "boost/config.hpp"
12
13 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
14
15 #   define BOOST_TT_BROKEN_COMPILER_SPEC(T) /**/
16
17 #else
18
19 namespace boost {
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;
26 }
27
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> \
32 { \
33     typedef result type; \
34 }; \
35 /**/
36
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)              \
45     /**/
46
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)                     \
50     /**/
51
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)                       \
57     /**/
58
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)                                \
62     /**/
63
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*)                          \
69     /**/
70
71 #   define BOOST_TT_BROKEN_COMPILER_SPEC(T)                                         \
72     namespace boost {                                                               \
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*)                          \
79     }                                                                               \
80     /**/
81
82 #   include "boost/type_traits/detail/type_trait_undef.hpp"
83
84 #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
85
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)
90 #endif
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)
102
103 // for backward compatibility
104 #define BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(T) \
105     BOOST_TT_BROKEN_COMPILER_SPEC(T) \
106 /**/
107
108 #endif // BOOST_TT_BROKEN_COMPILER_SPEC_HPP_INCLUDED