forked from boostorg/type_traits
Tentative fix for msvc-10 issue with rvalue refs.
See: https://svn.boost.org/trac10/ticket/5795 and https://github.com/boostorg/type_traits/issues/78.
This commit is contained in:
@ -0,0 +1,30 @@
|
||||
|
||||
// (C) Copyright John Maddock 2018.
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_IS_RVALUE_REFERENCE_MSVC10_FIX_HPP_INCLUDED
|
||||
#define BOOST_TT_IS_RVALUE_REFERENCE_MSVC10_FIX_HPP_INCLUDED
|
||||
|
||||
namespace boost {
|
||||
|
||||
template <class R> struct is_rvalue_reference<R(&&)()> : public true_type {};
|
||||
template <class R> struct is_rvalue_reference<R(&&)(...)> : public true_type {};
|
||||
template <class R, class Arg1> struct is_rvalue_reference<R(&&)(Arg1)> : public true_type {};
|
||||
template <class R, class Arg1> struct is_rvalue_reference<R(&&)(Arg1, ...)> : public true_type {};
|
||||
template <class R, class Arg1, class Arg2> struct is_rvalue_reference<R(&&)(Arg1, Arg2)> : public true_type {};
|
||||
template <class R, class Arg1, class Arg2> struct is_rvalue_reference<R(&&)(Arg1, Arg2, ...)> : public true_type {};
|
||||
template <class R, class Arg1, class Arg2, class Arg3> struct is_rvalue_reference<R(&&)(Arg1, Arg2, Arg3)> : public true_type {};
|
||||
template <class R, class Arg1, class Arg2, class Arg3> struct is_rvalue_reference<R(&&)(Arg1, Arg2, Arg3, ...)> : public true_type {};
|
||||
template <class R, class Arg1, class Arg2, class Arg3, class Arg4> struct is_rvalue_reference<R(&&)(Arg1, Arg2, Arg3, Arg4)> : public true_type {};
|
||||
template <class R, class Arg1, class Arg2, class Arg3, class Arg4> struct is_rvalue_reference<R(&&)(Arg1, Arg2, Arg3, Arg4, ...)> : public true_type {};
|
||||
template <class R, class Arg1, class Arg2, class Arg3, class Arg4, class Arg5> struct is_rvalue_reference<R(&&)(Arg1, Arg2, Arg3, Arg4, Arg5)> : public true_type {};
|
||||
template <class R, class Arg1, class Arg2, class Arg3, class Arg4, class Arg5> struct is_rvalue_reference<R(&&)(Arg1, Arg2, Arg3, Arg4, Arg5, ...)> : public true_type {};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TT_IS_REFERENCE_HPP_INCLUDED
|
||||
|
@ -21,5 +21,9 @@ template <class T> struct is_rvalue_reference<T&&> : public true_type {};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, <= 1700)
|
||||
#include <boost/type_traits/detail/is_rvalue_reference_msvc10_fix.hpp>
|
||||
#endif
|
||||
|
||||
#endif // BOOST_TT_IS_REFERENCE_HPP_INCLUDED
|
||||
|
||||
|
@ -19,20 +19,19 @@
|
||||
|
||||
TT_TEST_BEGIN(rvalue_reference_test)
|
||||
|
||||
#if !(defined(CI_SUPPRESS_KNOWN_ISSUES) && BOOST_WORKAROUND(BOOST_MSVC, <= 1700))
|
||||
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_reference<int (&&)(int)>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_rvalue_reference<int (&)(int)>::value, false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_rvalue_reference<int (&&)(int)>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_rvalue_reference<int(&&)(int, ...)>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_rvalue_reference<void(&&)(void)>::value, true);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_rvalue_reference<void(&&)(int, double const&)>::value, true);
|
||||
#if !(defined(CI_SUPPRESS_KNOWN_ISSUES) && BOOST_WORKAROUND(BOOST_GCC, < 40700))
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<int&&, int&>::value), false);
|
||||
BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible<int(), int(&&)()>::value), true);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
TT_TEST_END
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user