fixing stuff
[dyninst.git] / dynutil / h / dyn_detail / boost / type_traits / add_reference.hpp
1
2 //  (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
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_ADD_REFERENCE_HPP_INCLUDED
10 #define DYN_DETAIL_BOOST_TT_ADD_REFERENCE_HPP_INCLUDED
11
12 #include <dyn_detail/boost/type_traits/is_reference.hpp>
13 #include <dyn_detail/boost/detail/workaround.hpp>
14 #include <dyn_detail/boost/config.hpp>
15
16 // should be the last #include
17 #include <dyn_detail/boost/type_traits/detail/type_trait_def.hpp>
18
19 namespace dyn_detail {
20 namespace boost {
21
22 namespace detail {
23
24 #if defined(DYN_DETAIL_BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && defined(DYN_DETAIL_BOOST_MSVC6_MEMBER_TEMPLATES)
25
26 template <bool x>
27 struct reference_adder
28 {
29     template <typename T> struct result_
30     {
31         typedef T& type;
32     };
33 };
34
35 template <>
36 struct reference_adder<true>
37 {
38     template <typename T> struct result_
39     {
40         typedef T type;
41     };
42 };
43
44 template <typename T>
45 struct add_reference_impl
46 {
47     typedef typename reference_adder<
48           ::dyn_detail::boost::is_reference<T>::value
49         >::template result_<T> result;
50
51     typedef typename result::type type;
52 };
53
54 #else
55
56 template <typename T>
57 struct add_reference_impl
58 {
59     typedef T& type;
60 };
61
62 #ifndef DYN_DETAIL_BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
63 DYN_DETAIL_BOOST_TT_AUX_TYPE_TRAIT_IMPL_PARTIAL_SPEC1_1(typename T,add_reference,T&,T&)
64 #endif
65
66 #endif
67
68 // these full specialisations are always required:
69 DYN_DETAIL_BOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1(add_reference,void,void)
70 #ifndef DYN_DETAIL_BOOST_NO_CV_VOID_SPECIALIZATIONS
71 DYN_DETAIL_BOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1(add_reference,void const,void const)
72 DYN_DETAIL_BOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1(add_reference,void volatile,void volatile)
73 DYN_DETAIL_BOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1(add_reference,void const volatile,void const volatile)
74 #endif
75
76 } // namespace detail
77
78 DYN_DETAIL_BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_reference,T,typename ::dyn_detail::boost::detail::add_reference_impl<T>::type)
79
80 // agurt, 07/mar/03: workaround Borland's ill-formed sensitivity to an additional
81 // level of indirection, here
82 #if DYN_DETAIL_BOOST_WORKAROUND(__BORLANDC__, < 0x600)
83 DYN_DETAIL_BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,add_reference,T&,T&)
84 #endif
85
86 } // namespace boost
87 } // namespace dyn_detail
88
89 #include <dyn_detail/boost/type_traits/detail/type_trait_undef.hpp>
90
91 #endif // DYN_DETAIL_BOOST_TT_ADD_REFERENCE_HPP_INCLUDED