From 2a50f7caad405bb976e726c3663285f521e236e0 Mon Sep 17 00:00:00 2001 From: Joel de Guzman Date: Wed, 19 Nov 2014 08:31:35 +0800 Subject: [PATCH] Better patch from Kohei Takahashi! Allows good forwarding on C++11 while still allowing C++03. --- include/boost/fusion/support/pair.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/boost/fusion/support/pair.hpp b/include/boost/fusion/support/pair.hpp index a01b79bd..965810de 100644 --- a/include/boost/fusion/support/pair.hpp +++ b/include/boost/fusion/support/pair.hpp @@ -16,6 +16,7 @@ #include #include #include +#include #if defined (BOOST_MSVC) # pragma warning(push) @@ -48,6 +49,17 @@ namespace boost { namespace fusion pair(typename detail::call_param::type val) : second(val) {} +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) + + BOOST_FUSION_GPU_ENABLED + template + pair(Second2&& val + , typename boost::disable_if >::type* /* dummy */ = 0 + , typename boost::enable_if >::type* /*dummy*/ = 0 + ) : second(std::forward(val)) {} + +#endif + template BOOST_FUSION_GPU_ENABLED pair(pair const& rhs)