1 // (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
2 // Permission to copy, use, modify, sell and distribute this software is
3 // granted provided this copyright notice appears in all copies. This software
4 // is provided "as is" without express or implied warranty, and with no claim
5 // as to its suitability for any purpose.
7 // See http://www.boost.org for most recent version including documentation.
9 #ifndef BOOST_TT_ADD_REFERENCE_HPP_INCLUDED
10 #define BOOST_TT_ADD_REFERENCE_HPP_INCLUDED
12 #include "boost/type_traits/is_reference.hpp"
13 #include "boost/detail/workaround.hpp"
14 #include "boost/config.hpp"
16 // should be the last #include
17 #include "boost/type_traits/detail/type_trait_def.hpp"
23 #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && defined(BOOST_MSVC6_MEMBER_TEMPLATES)
26 struct reference_adder
28 template <typename T> struct result_
35 struct reference_adder<true>
37 template <typename T> struct result_
44 struct add_reference_impl
46 typedef typename reference_adder<
47 ::boost::is_reference<T>::value
48 >::template result_<T> result;
50 typedef typename result::type type;
56 struct add_reference_impl
61 #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
62 BOOST_TT_AUX_TYPE_TRAIT_IMPL_PARTIAL_SPEC1_1(typename T,add_reference,T&,T&)
67 // these full specialisations are always required:
68 BOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1(add_reference,void,void)
69 #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
70 BOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1(add_reference,void const,void const)
71 BOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1(add_reference,void volatile,void volatile)
72 BOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1(add_reference,void const volatile,void const volatile)
77 BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_reference,T,typename detail::add_reference_impl<T>::type)
79 // agurt, 07/mar/03: workaround Borland's ill-formed sensitivity to an additional
80 // level of indirection, here
81 #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561))
82 BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,add_reference,T&,T&)
87 #include "boost/type_traits/detail/type_trait_undef.hpp"
89 #endif // BOOST_TT_ADD_REFERENCE_HPP_INCLUDED