]> git.lyx.org Git - lyx.git/blob - boost/boost/type_traits/add_reference.hpp
complie fix
[lyx.git] / boost / boost / type_traits / add_reference.hpp
1
2 // (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
3 // Permission to copy, use, modify, sell and distribute this software is 
4 // granted provided this copyright notice appears in all copies. This software 
5 // is provided "as is" without express or implied warranty, and with no claim 
6 // as to its suitability for any purpose.
7 //
8 // See http://www.boost.org for most recent version including documentation.
9
10 #ifndef BOOST_TT_ADD_REFERENCE_HPP_INCLUDED
11 #define BOOST_TT_ADD_REFERENCE_HPP_INCLUDED
12
13 #include "boost/type_traits/is_reference.hpp"
14 #include "boost/config.hpp"
15
16 // should be the last #include
17 #include "boost/type_traits/detail/type_trait_def.hpp"
18
19 namespace boost {
20
21 #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
22
23 BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_reference,T,T&)
24 BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,add_reference,T&,T&)
25
26 #elif defined(BOOST_MSVC6_MEMBER_TEMPLATES)
27
28 namespace detail {
29
30 template <bool x>
31 struct reference_adder
32 {
33     template <typename T> struct result_
34     {
35         typedef T& type;
36     };
37 };
38
39 template <>
40 struct reference_adder<true>
41 {
42     template <typename T> struct result_
43     {
44         typedef T type;
45     };
46 };
47
48 template <typename T>
49 struct add_reference_impl
50 {
51     typedef typename reference_adder<
52           ::boost::is_reference<T>::value
53         >::template result_<T> result;
54
55     typedef typename result::type type;
56 };
57
58 } // namespace detail
59
60 BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_reference,T,typename detail::add_reference_impl<T>::type)
61
62 #else
63
64 BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_reference,T,T&)
65
66 #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
67
68 //
69 // these full specialisations are always required:
70 BOOST_TT_AUX_TYPE_TRAIT_SPEC1(add_reference,void,void)
71 #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
72 BOOST_TT_AUX_TYPE_TRAIT_SPEC1(add_reference,void const,void const)
73 BOOST_TT_AUX_TYPE_TRAIT_SPEC1(add_reference,void volatile,void volatile)
74 BOOST_TT_AUX_TYPE_TRAIT_SPEC1(add_reference,void const volatile,void const volatile)
75 #endif
76
77 } // namespace boost
78
79 #include "boost/type_traits/detail/type_trait_undef.hpp"
80
81 #endif // BOOST_TT_ADD_REFERENCE_HPP_INCLUDED