mirror of
https://github.com/boostorg/core.git
synced 2025-08-11 10:44:51 +02:00
Work around msvc-10.0 ref_fn_test failure.
This commit is contained in:
@@ -39,6 +39,12 @@
|
|||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, == 1600 )
|
||||||
|
|
||||||
|
struct ref_workaround_tag {};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
// reference_wrapper
|
// reference_wrapper
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -66,6 +72,12 @@ public:
|
|||||||
*/
|
*/
|
||||||
BOOST_FORCEINLINE explicit reference_wrapper(T& t): t_(boost::addressof(t)) {}
|
BOOST_FORCEINLINE explicit reference_wrapper(T& t): t_(boost::addressof(t)) {}
|
||||||
|
|
||||||
|
#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, == 1600 )
|
||||||
|
|
||||||
|
BOOST_FORCEINLINE explicit reference_wrapper( T & t, ref_workaround_tag ): t_( boost::addressof( t ) ) {}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||||
/**
|
/**
|
||||||
@remark Construction from a temporary object is disabled.
|
@remark Construction from a temporary object is disabled.
|
||||||
@@ -118,7 +130,15 @@ private:
|
|||||||
*/
|
*/
|
||||||
template<class T> BOOST_FORCEINLINE reference_wrapper<T> BOOST_REF_CONST ref( T & t )
|
template<class T> BOOST_FORCEINLINE reference_wrapper<T> BOOST_REF_CONST ref( T & t )
|
||||||
{
|
{
|
||||||
|
#if defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, == 1600 )
|
||||||
|
|
||||||
|
return reference_wrapper<T>( t, ref_workaround_tag() );
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
return reference_wrapper<T>( t );
|
return reference_wrapper<T>( t );
|
||||||
|
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -127,7 +147,7 @@ template<class T> BOOST_FORCEINLINE reference_wrapper<T> BOOST_REF_CONST ref( T
|
|||||||
*/
|
*/
|
||||||
template<class T> BOOST_FORCEINLINE reference_wrapper<T> BOOST_REF_CONST ref( reference_wrapper<T> t )
|
template<class T> BOOST_FORCEINLINE reference_wrapper<T> BOOST_REF_CONST ref( reference_wrapper<T> t )
|
||||||
{
|
{
|
||||||
return reference_wrapper<T>(t.get());
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
// cref
|
// cref
|
||||||
|
Reference in New Issue
Block a user