forked from boostorg/type_traits
more refactoring corrections
[SVN r17611]
This commit is contained in:
@ -18,23 +18,10 @@
|
||||
|
||||
namespace boost {
|
||||
|
||||
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
|
||||
BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_reference,T,T&)
|
||||
BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,add_reference,T&,T&)
|
||||
|
||||
// these full specialisations are always required:
|
||||
BOOST_TT_AUX_TYPE_TRAIT_SPEC1(add_reference,void,void)
|
||||
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
|
||||
BOOST_TT_AUX_TYPE_TRAIT_SPEC1(add_reference,void const,void const)
|
||||
BOOST_TT_AUX_TYPE_TRAIT_SPEC1(add_reference,void volatile,void volatile)
|
||||
BOOST_TT_AUX_TYPE_TRAIT_SPEC1(add_reference,void const volatile,void const volatile)
|
||||
#endif
|
||||
|
||||
#elif defined(BOOST_MSVC6_MEMBER_TEMPLATES)
|
||||
|
||||
namespace detail {
|
||||
|
||||
#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && defined(BOOST_MSVC6_MEMBER_TEMPLATES)
|
||||
|
||||
template <bool x>
|
||||
struct reference_adder
|
||||
{
|
||||
@ -63,6 +50,20 @@ struct add_reference_impl
|
||||
typedef typename result::type type;
|
||||
};
|
||||
|
||||
#else
|
||||
|
||||
template <typename T>
|
||||
struct add_reference_impl
|
||||
{
|
||||
typedef T& type;
|
||||
};
|
||||
|
||||
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
BOOST_TT_AUX_TYPE_TRAIT_IMPL_PARTIAL_SPEC1_1(typename T,add_reference,T&,T&)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
// these full specialisations are always required:
|
||||
BOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1(add_reference,void,void)
|
||||
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
|
||||
@ -75,9 +76,6 @@ BOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1(add_reference,void const volatile,void const
|
||||
|
||||
BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_reference,T,typename detail::add_reference_impl<T>::type)
|
||||
|
||||
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
||||
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#include "boost/type_traits/detail/type_trait_undef.hpp"
|
||||
|
@ -57,3 +57,10 @@ template< param1, param2 > struct trait<spec> \
|
||||
typedef result; \
|
||||
}; \
|
||||
/**/
|
||||
|
||||
#define BOOST_TT_AUX_TYPE_TRAIT_IMPL_PARTIAL_SPEC1_1(param,trait,spec,result) \
|
||||
template< param > struct trait##_impl<spec> \
|
||||
{ \
|
||||
typedef result type; \
|
||||
}; \
|
||||
/**/
|
||||
|
@ -21,3 +21,4 @@
|
||||
#undef BOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1
|
||||
#undef BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1
|
||||
#undef BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2
|
||||
#undef BOOST_TT_AUX_TYPE_TRAIT_IMPL_PARTIAL_SPEC1_1
|
||||
|
Reference in New Issue
Block a user