]> git.lyx.org Git - lyx.git/blob - boost/boost/type_traits/broken_compiler_spec.hpp
update to boost 1.30.1
[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/mpl/aux_/lambda_support.hpp"
12 #include "boost/config.hpp"
13
14 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
15
16 #   define BOOST_TT_BROKEN_COMPILER_SPEC(T) /**/
17
18 #else
19
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; };
25 }}
26
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> \
31 { \
32     typedef result type; \
33 }; \
34 /**/
35
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)  \
41     /**/
42
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)                     \
46     /**/
47
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)                       \
53     /**/
54
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)                                \
58     /**/
59
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*)                          \
65     /**/
66
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*)                          \
75     }}                                                                              \
76     /**/
77
78 #   include "boost/type_traits/detail/type_trait_undef.hpp"
79
80 #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
81
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)
86 #endif
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)
98
99 // for backward compatibility
100 #define BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(T) \
101     BOOST_TT_BROKEN_COMPILER_SPEC(T) \
102 /**/
103
104 #endif // BOOST_TT_BROKEN_COMPILER_SPEC_HPP_INCLUDED