Work around msvc-10.0 ref_fn_test failure.

This commit is contained in:
Peter Dimov
2014-06-11 19:47:25 +03:00
parent 0b2dea1f36
commit 3a10e3f5c6

View File

@@ -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