00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef BOOST_TT_ADD_REFERENCE_HPP_INCLUDED
00010 #define BOOST_TT_ADD_REFERENCE_HPP_INCLUDED
00011
00012 #include <boost/type_traits/is_reference.hpp>
00013 #include <boost/detail/workaround.hpp>
00014 #include <boost/config.hpp>
00015
00016
00017 #include <boost/type_traits/detail/type_trait_def.hpp>
00018
00019 namespace boost {
00020
00021 namespace detail {
00022
00023 #if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && defined(BOOST_MSVC6_MEMBER_TEMPLATES)
00024
00025 template <bool x>
00026 struct reference_adder
00027 {
00028 template <typename T> struct result_
00029 {
00030 typedef T& type;
00031 };
00032 };
00033
00034 template <>
00035 struct reference_adder<true>
00036 {
00037 template <typename T> struct result_
00038 {
00039 typedef T type;
00040 };
00041 };
00042
00043 template <typename T>
00044 struct add_reference_impl
00045 {
00046 typedef typename reference_adder<
00047 ::boost::is_reference<T>::value
00048 >::template result_<T> result;
00049
00050 typedef typename result::type type;
00051 };
00052
00053 #else
00054
00055 template <typename T>
00056 struct add_reference_impl
00057 {
00058 typedef T& type;
00059 };
00060
00061 #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
00062 BOOST_TT_AUX_TYPE_TRAIT_IMPL_PARTIAL_SPEC1_1(typename T,add_reference,T&,T&)
00063 #endif
00064
00065 #endif
00066
00067
00068 BOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1(add_reference,void,void)
00069 #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
00070 BOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1(add_reference,void const,void const)
00071 BOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1(add_reference,void volatile,void volatile)
00072 BOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1(add_reference,void const volatile,void const volatile)
00073 #endif
00074
00075 }
00076
00077 BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_reference,T,typename boost::detail::add_reference_impl<T>::type)
00078
00079
00080
00081 #if BOOST_WORKAROUND(__BORLANDC__, < 0x600)
00082 BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,add_reference,T&,T&)
00083 #endif
00084
00085 }
00086
00087 #include <boost/type_traits/detail/type_trait_undef.hpp>
00088
00089 #endif // BOOST_TT_ADD_REFERENCE_HPP_INCLUDED