forked from boostorg/core
Remove BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
Process #ifndef...#else...#endif blocks. [SVN r86245]
This commit is contained in:
committed by
Peter Dimov
parent
01559a8b20
commit
3ca731ba5c
@@ -65,7 +65,6 @@ template<class T> BOOST_FORCEINLINE reference_wrapper<T const> BOOST_REF_CONST
|
|||||||
|
|
||||||
# undef BOOST_REF_CONST
|
# undef BOOST_REF_CONST
|
||||||
|
|
||||||
# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
class is_reference_wrapper
|
class is_reference_wrapper
|
||||||
@@ -104,66 +103,6 @@ AUX_REFERENCE_WRAPPER_METAFUNCTIONS_DEF(reference_wrapper<T> const volatile)
|
|||||||
|
|
||||||
# undef AUX_REFERENCE_WRAPPER_METAFUNCTIONS_DEF
|
# undef AUX_REFERENCE_WRAPPER_METAFUNCTIONS_DEF
|
||||||
|
|
||||||
# else // no partial specialization
|
|
||||||
|
|
||||||
} // namespace boost
|
|
||||||
|
|
||||||
#include <boost/type.hpp>
|
|
||||||
|
|
||||||
namespace boost
|
|
||||||
{
|
|
||||||
|
|
||||||
namespace detail
|
|
||||||
{
|
|
||||||
typedef char (&yes_reference_wrapper_t)[1];
|
|
||||||
typedef char (&no_reference_wrapper_t)[2];
|
|
||||||
|
|
||||||
no_reference_wrapper_t is_reference_wrapper_test(...);
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
yes_reference_wrapper_t is_reference_wrapper_test(type< reference_wrapper<T> >);
|
|
||||||
|
|
||||||
template<bool wrapped>
|
|
||||||
struct reference_unwrapper
|
|
||||||
{
|
|
||||||
template <class T>
|
|
||||||
struct apply
|
|
||||||
{
|
|
||||||
typedef T type;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
template<>
|
|
||||||
struct reference_unwrapper<true>
|
|
||||||
{
|
|
||||||
template <class T>
|
|
||||||
struct apply
|
|
||||||
{
|
|
||||||
typedef typename T::type type;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
class is_reference_wrapper
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
BOOST_STATIC_CONSTANT(
|
|
||||||
bool, value = (
|
|
||||||
sizeof(detail::is_reference_wrapper_test(type<T>()))
|
|
||||||
== sizeof(detail::yes_reference_wrapper_t)));
|
|
||||||
|
|
||||||
typedef ::boost::mpl::bool_<value> type;
|
|
||||||
};
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
class unwrap_reference
|
|
||||||
: public detail::reference_unwrapper<
|
|
||||||
is_reference_wrapper<T>::value
|
|
||||||
>::template apply<T>
|
|
||||||
{};
|
|
||||||
|
|
||||||
# endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
|
|
||||||
|
|
||||||
template <class T> BOOST_FORCEINLINE typename unwrap_reference<T>::type&
|
template <class T> BOOST_FORCEINLINE typename unwrap_reference<T>::type&
|
||||||
unwrap_ref(T& t)
|
unwrap_ref(T& t)
|
||||||
|
|||||||
Reference in New Issue
Block a user