fixing stuff
[dyninst.git] / dynutil / h / dyn_detail / boost / type_traits / broken_compiler_spec.hpp
1
2 //  Copyright 2001-2003 Aleksey Gurtovoy.
3 //  Use, modification and distribution are subject to the Boost Software License,
4 //  Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
5 //  http://www.boost.org/LICENSE_1_0.txt).
6 //
7 //  See http://www.boost.org/libs/type_traits for most recent version including documentation.
8
9 #ifndef DYN_DETAIL_BOOST_TT_BROKEN_COMPILER_SPEC_HPP_INCLUDED
10 #define DYN_DETAIL_BOOST_TT_BROKEN_COMPILER_SPEC_HPP_INCLUDED
11
12 #include <dyn_detail/boost/mpl/aux_/lambda_support.hpp>
13 #include <dyn_detail/boost/config.hpp>
14
15 // these are needed regardless of DYN_DETAIL_BOOST_TT_NO_BROKEN_COMPILER_SPEC 
16 #if defined(DYN_DETAIL_BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
17 namespace dyn_detail {namespace boost { namespace detail {
18 template< typename T > struct remove_const_impl     { typedef T type; };
19 template< typename T > struct remove_volatile_impl  { typedef T type; };
20 template< typename T > struct remove_pointer_impl   { typedef T type; };
21 template< typename T > struct remove_reference_impl { typedef T type; };
22 typedef int invoke_DYN_DETAIL_BOOST_TT_BROKEN_COMPILER_SPEC_outside_all_namespaces;
23 }}}
24 #endif
25
26 // agurt, 27/jun/03: disable the workaround if user defined 
27 // DYN_DETAIL_BOOST_TT_NO_BROKEN_COMPILER_SPEC
28 #if    !defined(DYN_DETAIL_BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
29     || defined(DYN_DETAIL_BOOST_TT_NO_BROKEN_COMPILER_SPEC)
30
31 #   define DYN_DETAIL_BOOST_TT_BROKEN_COMPILER_SPEC(T) /**/
32
33 #else
34
35 // same as DYN_DETAIL_BOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1 macro, except that it
36 // never gets #undef-ined
37 #   define DYN_DETAIL_BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(trait,spec,result) \
38 template<> struct trait##_impl<spec> \
39 { \
40     typedef result type; \
41 }; \
42 /**/
43
44 #   define DYN_DETAIL_BOOST_TT_AUX_REMOVE_CONST_VOLATILE_RANK1_SPEC(T)                         \
45     DYN_DETAIL_BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_const,T const,T)                    \
46     DYN_DETAIL_BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_const,T const volatile,T volatile)  \
47     DYN_DETAIL_BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_volatile,T volatile,T)              \
48     DYN_DETAIL_BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_volatile,T const volatile,T const)  \
49     /**/
50
51 #   define DYN_DETAIL_BOOST_TT_AUX_REMOVE_PTR_REF_RANK_1_SPEC(T)                               \
52     DYN_DETAIL_BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_pointer,T*,T)                       \
53     DYN_DETAIL_BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_pointer,T*const,T)                  \
54     DYN_DETAIL_BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_pointer,T*volatile,T)               \
55     DYN_DETAIL_BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_pointer,T*const volatile,T)         \
56     DYN_DETAIL_BOOST_TT_AUX_BROKEN_TYPE_TRAIT_SPEC1(remove_reference,T&,T)                     \
57     /**/
58
59 #   define DYN_DETAIL_BOOST_TT_AUX_REMOVE_PTR_REF_RANK_2_SPEC(T)                               \
60     DYN_DETAIL_BOOST_TT_AUX_REMOVE_PTR_REF_RANK_1_SPEC(T)                                      \
61     DYN_DETAIL_BOOST_TT_AUX_REMOVE_PTR_REF_RANK_1_SPEC(T const)                                \
62     DYN_DETAIL_BOOST_TT_AUX_REMOVE_PTR_REF_RANK_1_SPEC(T volatile)                             \
63     DYN_DETAIL_BOOST_TT_AUX_REMOVE_PTR_REF_RANK_1_SPEC(T const volatile)                       \
64     /**/
65
66 #   define DYN_DETAIL_BOOST_TT_AUX_REMOVE_ALL_RANK_1_SPEC(T)                                   \
67     DYN_DETAIL_BOOST_TT_AUX_REMOVE_PTR_REF_RANK_2_SPEC(T)                                      \
68     DYN_DETAIL_BOOST_TT_AUX_REMOVE_CONST_VOLATILE_RANK1_SPEC(T)                                \
69     /**/
70
71 #   define DYN_DETAIL_BOOST_TT_AUX_REMOVE_ALL_RANK_2_SPEC(T)                                   \
72     DYN_DETAIL_BOOST_TT_AUX_REMOVE_ALL_RANK_1_SPEC(T*)                                         \
73     DYN_DETAIL_BOOST_TT_AUX_REMOVE_ALL_RANK_1_SPEC(T const*)                                   \
74     DYN_DETAIL_BOOST_TT_AUX_REMOVE_ALL_RANK_1_SPEC(T volatile*)                                \
75     DYN_DETAIL_BOOST_TT_AUX_REMOVE_ALL_RANK_1_SPEC(T const volatile*)                          \
76     /**/
77
78 #   define DYN_DETAIL_BOOST_TT_BROKEN_COMPILER_SPEC(T)                                         \
79     namespace dyn_detail {namespace boost { namespace detail {                                            \
80     typedef invoke_DYN_DETAIL_BOOST_TT_BROKEN_COMPILER_SPEC_outside_all_namespaces             \
81       please_invoke_DYN_DETAIL_BOOST_TT_BROKEN_COMPILER_SPEC_outside_all_namespaces;           \
82     DYN_DETAIL_BOOST_TT_AUX_REMOVE_ALL_RANK_1_SPEC(T)                                          \
83     DYN_DETAIL_BOOST_TT_AUX_REMOVE_ALL_RANK_2_SPEC(T)                                          \
84     DYN_DETAIL_BOOST_TT_AUX_REMOVE_ALL_RANK_2_SPEC(T*)                                         \
85     DYN_DETAIL_BOOST_TT_AUX_REMOVE_ALL_RANK_2_SPEC(T const*)                                   \
86     DYN_DETAIL_BOOST_TT_AUX_REMOVE_ALL_RANK_2_SPEC(T volatile*)                                \
87     DYN_DETAIL_BOOST_TT_AUX_REMOVE_ALL_RANK_2_SPEC(T const volatile*)                          \
88     }}}                                                                              \
89     /**/
90
91 #   include <dyn_detail/boost/type_traits/detail/type_trait_undef.hpp>
92
93 #endif // DYN_DETAIL_BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
94
95 DYN_DETAIL_BOOST_TT_BROKEN_COMPILER_SPEC(bool)
96 DYN_DETAIL_BOOST_TT_BROKEN_COMPILER_SPEC(char)
97 #ifndef DYN_DETAIL_BOOST_NO_INTRINSIC_WCHAR_T
98 DYN_DETAIL_BOOST_TT_BROKEN_COMPILER_SPEC(wchar_t)
99 #endif
100 DYN_DETAIL_BOOST_TT_BROKEN_COMPILER_SPEC(signed char)
101 DYN_DETAIL_BOOST_TT_BROKEN_COMPILER_SPEC(unsigned char)
102 DYN_DETAIL_BOOST_TT_BROKEN_COMPILER_SPEC(signed short)
103 DYN_DETAIL_BOOST_TT_BROKEN_COMPILER_SPEC(unsigned short)
104 DYN_DETAIL_BOOST_TT_BROKEN_COMPILER_SPEC(signed int)
105 DYN_DETAIL_BOOST_TT_BROKEN_COMPILER_SPEC(unsigned int)
106 DYN_DETAIL_BOOST_TT_BROKEN_COMPILER_SPEC(signed long)
107 DYN_DETAIL_BOOST_TT_BROKEN_COMPILER_SPEC(unsigned long)
108 DYN_DETAIL_BOOST_TT_BROKEN_COMPILER_SPEC(float)
109 DYN_DETAIL_BOOST_TT_BROKEN_COMPILER_SPEC(double)
110 //DYN_DETAIL_BOOST_TT_BROKEN_COMPILER_SPEC(long double)
111
112 // for backward compatibility
113 #define DYN_DETAIL_BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(T) \
114     DYN_DETAIL_BOOST_TT_BROKEN_COMPILER_SPEC(T) \
115 /**/
116
117 #endif // DYN_DETAIL_BOOST_TT_BROKEN_COMPILER_SPEC_HPP_INCLUDED