From 0c59e22982d6d534877ffa2dde2c685f3d98ed4c Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Mon, 6 Aug 2018 18:31:26 +0100 Subject: [PATCH 1/4] 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. --- .../detail/is_rvalue_reference_msvc10_fix.hpp | 30 +++++++++++++++++++ .../boost/type_traits/is_rvalue_reference.hpp | 4 +++ test/tricky_rvalue_test.cpp | 7 ++--- 3 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 include/boost/type_traits/detail/is_rvalue_reference_msvc10_fix.hpp diff --git a/include/boost/type_traits/detail/is_rvalue_reference_msvc10_fix.hpp b/include/boost/type_traits/detail/is_rvalue_reference_msvc10_fix.hpp new file mode 100644 index 0000000..4f9796b --- /dev/null +++ b/include/boost/type_traits/detail/is_rvalue_reference_msvc10_fix.hpp @@ -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 struct is_rvalue_reference : public true_type {}; +template struct is_rvalue_reference : public true_type {}; +template struct is_rvalue_reference : public true_type {}; +template struct is_rvalue_reference : public true_type {}; +template struct is_rvalue_reference : public true_type {}; +template struct is_rvalue_reference : public true_type {}; +template struct is_rvalue_reference : public true_type {}; +template struct is_rvalue_reference : public true_type {}; +template struct is_rvalue_reference : public true_type {}; +template struct is_rvalue_reference : public true_type {}; +template struct is_rvalue_reference : public true_type {}; +template struct is_rvalue_reference : public true_type {}; + +} // namespace boost + +#endif // BOOST_TT_IS_REFERENCE_HPP_INCLUDED + diff --git a/include/boost/type_traits/is_rvalue_reference.hpp b/include/boost/type_traits/is_rvalue_reference.hpp index a48edb5..37d33c9 100644 --- a/include/boost/type_traits/is_rvalue_reference.hpp +++ b/include/boost/type_traits/is_rvalue_reference.hpp @@ -21,5 +21,9 @@ template struct is_rvalue_reference : public true_type {}; } // namespace boost +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, <= 1700) +#include +#endif + #endif // BOOST_TT_IS_REFERENCE_HPP_INCLUDED diff --git a/test/tricky_rvalue_test.cpp b/test/tricky_rvalue_test.cpp index 8199edc..c12f6ec 100644 --- a/test/tricky_rvalue_test.cpp +++ b/test/tricky_rvalue_test.cpp @@ -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::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_rvalue_reference::value, false); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_rvalue_reference::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_rvalue_reference::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_rvalue_reference::value, true); +BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_rvalue_reference::value, true); #if !(defined(CI_SUPPRESS_KNOWN_ISSUES) && BOOST_WORKAROUND(BOOST_GCC, < 40700)) BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), false); BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), true); #endif #endif -#endif - TT_TEST_END From e958c63a6dd721d24ca1d7e40d6c207c90c91bee Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Mon, 6 Aug 2018 19:20:34 +0100 Subject: [PATCH 2/4] rvalue refs and msvc-10: add fix for is_function as well. --- .../detail/is_function_msvc10_fix.hpp | 30 +++++++++++++++++++ include/boost/type_traits/is_function.hpp | 4 +++ 2 files changed, 34 insertions(+) create mode 100644 include/boost/type_traits/detail/is_function_msvc10_fix.hpp diff --git a/include/boost/type_traits/detail/is_function_msvc10_fix.hpp b/include/boost/type_traits/detail/is_function_msvc10_fix.hpp new file mode 100644 index 0000000..ec8ba9a --- /dev/null +++ b/include/boost/type_traits/detail/is_function_msvc10_fix.hpp @@ -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_FUNCTION_MSVC10_FIX_HPP_INCLUDED +#define BOOST_TT_IS_FUNCTION_MSVC10_FIX_HPP_INCLUDED + +namespace boost { + +template struct is_function : public false_type {}; +template struct is_function : public false_type {}; +template struct is_function : public false_type {}; +template struct is_function : public false_type {}; +template struct is_function : public false_type {}; +template struct is_function : public false_type {}; +template struct is_function : public false_type {}; +template struct is_function : public false_type {}; +template struct is_function : public false_type {}; +template struct is_function : public false_type {}; +template struct is_function : public false_type {}; +template struct is_function : public false_type {}; + +} // namespace boost + +#endif // BOOST_TT_IS_REFERENCE_HPP_INCLUDED + diff --git a/include/boost/type_traits/is_function.hpp b/include/boost/type_traits/is_function.hpp index f77c1f0..fe72ebf 100644 --- a/include/boost/type_traits/is_function.hpp +++ b/include/boost/type_traits/is_function.hpp @@ -99,4 +99,8 @@ template struct is_function : public false_type {}; #endif } // namespace boost +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && defined(BOOST_MSVC) && BOOST_WORKAROUND(BOOST_MSVC, <= 1700) +#include +#endif + #endif // BOOST_TT_IS_FUNCTION_HPP_INCLUDED From 8d740945a80bcac52b66ce78322bea1537745796 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Tue, 7 Aug 2018 17:59:11 +0100 Subject: [PATCH 3/4] is_rvalue_reference: More partial specialisations for obsolete compilers. --- .../detail/is_rvalue_reference_msvc10_fix.hpp | 13 +++++++++++++ test/tricky_rvalue_test.cpp | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/include/boost/type_traits/detail/is_rvalue_reference_msvc10_fix.hpp b/include/boost/type_traits/detail/is_rvalue_reference_msvc10_fix.hpp index 4f9796b..d570735 100644 --- a/include/boost/type_traits/detail/is_rvalue_reference_msvc10_fix.hpp +++ b/include/boost/type_traits/detail/is_rvalue_reference_msvc10_fix.hpp @@ -24,6 +24,19 @@ template struct is_rva template struct is_rvalue_reference : public true_type {}; template struct is_rvalue_reference : public true_type {}; +template struct is_rvalue_reference : public false_type {}; +template struct is_rvalue_reference : public false_type {}; +template struct is_rvalue_reference : public false_type {}; +template struct is_rvalue_reference : public false_type {}; +template struct is_rvalue_reference : public false_type {}; +template struct is_rvalue_reference : public false_type {}; +template struct is_rvalue_reference : public false_type {}; +template struct is_rvalue_reference : public false_type {}; +template struct is_rvalue_reference : public false_type {}; +template struct is_rvalue_reference : public false_type {}; +template struct is_rvalue_reference : public false_type {}; +template struct is_rvalue_reference : public false_type {}; + } // namespace boost #endif // BOOST_TT_IS_REFERENCE_HPP_INCLUDED diff --git a/test/tricky_rvalue_test.cpp b/test/tricky_rvalue_test.cpp index c12f6ec..0b03639 100644 --- a/test/tricky_rvalue_test.cpp +++ b/test/tricky_rvalue_test.cpp @@ -26,7 +26,7 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_rvalue_reference::value, t BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_rvalue_reference::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_rvalue_reference::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_rvalue_reference::value, true); -#if !(defined(CI_SUPPRESS_KNOWN_ISSUES) && BOOST_WORKAROUND(BOOST_GCC, < 40700)) +#if !(defined(CI_SUPPRESS_KNOWN_ISSUES) && (BOOST_WORKAROUND(BOOST_GCC, < 40700)) || BOOST_WORKAROUND(BOOST_MSVC, < 1700)) BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), false); BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), true); #endif From 56d111026c5ab2cf48fc939f9ccd59dd10bf3f79 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Tue, 7 Aug 2018 18:23:38 +0100 Subject: [PATCH 4/4] tricky_rvalue_test.cpp: correct msvc version workaround. --- test/tricky_rvalue_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tricky_rvalue_test.cpp b/test/tricky_rvalue_test.cpp index 0b03639..cbb03bb 100644 --- a/test/tricky_rvalue_test.cpp +++ b/test/tricky_rvalue_test.cpp @@ -26,7 +26,7 @@ BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_rvalue_reference::value, t BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_rvalue_reference::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_rvalue_reference::value, true); BOOST_CHECK_INTEGRAL_CONSTANT(::tt::is_rvalue_reference::value, true); -#if !(defined(CI_SUPPRESS_KNOWN_ISSUES) && (BOOST_WORKAROUND(BOOST_GCC, < 40700)) || BOOST_WORKAROUND(BOOST_MSVC, < 1700)) +#if !(defined(CI_SUPPRESS_KNOWN_ISSUES) && (BOOST_WORKAROUND(BOOST_GCC, < 40700)) || BOOST_WORKAROUND(BOOST_MSVC, <= 1700)) BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), false); BOOST_CHECK_INTEGRAL_CONSTANT((::tt::is_convertible::value), true); #endif