fixing stuff
[dyninst.git] / dynutil / h / dyn_detail / boost / type_traits / detail / cv_traits_impl.hpp
1
2 //  (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, Howard
3 //  Hinnant & John Maddock 2000.  
4 //  Use, modification and distribution are subject to the Boost Software License,
5 //  Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
6 //  http://www.boost.org/LICENSE_1_0.txt).
7 //
8 //  See http://www.boost.org/libs/type_traits for most recent version including documentation.
9
10
11 #ifndef DYN_DETAIL_BOOST_TT_DETAIL_CV_TRAITS_IMPL_HPP_INCLUDED
12 #define DYN_DETAIL_BOOST_TT_DETAIL_CV_TRAITS_IMPL_HPP_INCLUDED
13
14 #include <dyn_detail/boost/config.hpp>
15 #include <dyn_detail/boost/detail/workaround.hpp>
16
17 #ifndef DYN_DETAIL_BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
18
19 // implementation helper:
20
21
22 #if !(DYN_DETAIL_BOOST_WORKAROUND(__GNUC__,== 3) && DYN_DETAIL_BOOST_WORKAROUND(__GNUC_MINOR__, <= 2))
23 namespace dyn_detail {
24 namespace boost {
25 namespace detail {
26 #else
27 #include <dyn_detail/boost/type_traits/detail/yes_no_type.hpp>
28 namespace dyn_detail {
29 namespace boost {
30 namespace type_traits {
31 namespace gcc8503 {
32 #endif
33
34 template <typename T> struct cv_traits_imp {};
35
36 template <typename T>
37 struct cv_traits_imp<T*>
38 {
39     DYN_DETAIL_BOOST_STATIC_CONSTANT(bool, is_const = false);
40     DYN_DETAIL_BOOST_STATIC_CONSTANT(bool, is_volatile = false);
41     typedef T unqualified_type;
42 };
43
44 template <typename T>
45 struct cv_traits_imp<const T*>
46 {
47     DYN_DETAIL_BOOST_STATIC_CONSTANT(bool, is_const = true);
48     DYN_DETAIL_BOOST_STATIC_CONSTANT(bool, is_volatile = false);
49     typedef T unqualified_type;
50 };
51
52 template <typename T>
53 struct cv_traits_imp<volatile T*>
54 {
55     DYN_DETAIL_BOOST_STATIC_CONSTANT(bool, is_const = false);
56     DYN_DETAIL_BOOST_STATIC_CONSTANT(bool, is_volatile = true);
57     typedef T unqualified_type;
58 };
59
60 template <typename T>
61 struct cv_traits_imp<const volatile T*>
62 {
63     DYN_DETAIL_BOOST_STATIC_CONSTANT(bool, is_const = true);
64     DYN_DETAIL_BOOST_STATIC_CONSTANT(bool, is_volatile = true);
65     typedef T unqualified_type;
66 };
67
68 #if DYN_DETAIL_BOOST_WORKAROUND(__GNUC__,== 3) && DYN_DETAIL_BOOST_WORKAROUND(__GNUC_MINOR__, <= 2)
69 // We have to exclude function pointers 
70 // (see http://gcc.gnu.org/bugzilla/show_bug.cgi?8503)
71 yes_type mini_funcptr_tester(...);
72 no_type  mini_funcptr_tester(const volatile void*);
73
74 } // namespace gcc8503
75 } // namespace type_traits
76
77 namespace detail {
78
79 // Use the implementation above for non function pointers
80 template <typename T, unsigned Select 
81   = (unsigned)sizeof(dyn_detail::boost::type_traits::gcc8503::mini_funcptr_tester((T)0)) >
82 struct cv_traits_imp : dyn_detail::boost::type_traits::gcc8503::cv_traits_imp<T> { };
83
84 // Functions are never cv-qualified
85 template <typename T> struct cv_traits_imp<T*,1>
86 {
87     DYN_DETAIL_BOOST_STATIC_CONSTANT(bool, is_const = false);
88     DYN_DETAIL_BOOST_STATIC_CONSTANT(bool, is_volatile = false);
89     typedef T unqualified_type;
90 };
91
92 #endif
93
94 } // namespace detail
95 } // namespace boost 
96 } // namespace dyn_detail
97
98 #endif // DYN_DETAIL_BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
99
100 #endif // DYN_DETAIL_BOOST_TT_DETAIL_CV_TRAITS_IMPL_HPP_INCLUDED