mirror of
https://github.com/boostorg/fusion.git
synced 2025-07-25 10:07:24 +02:00
Better patch from Kohei Takahashi! Allows good forwarding on C++11
while still allowing C++03.
This commit is contained in:
@ -16,6 +16,7 @@
|
|||||||
#include <boost/config.hpp>
|
#include <boost/config.hpp>
|
||||||
#include <boost/utility/enable_if.hpp>
|
#include <boost/utility/enable_if.hpp>
|
||||||
#include <boost/type_traits/is_convertible.hpp>
|
#include <boost/type_traits/is_convertible.hpp>
|
||||||
|
#include <boost/type_traits/is_lvalue_reference.hpp>
|
||||||
|
|
||||||
#if defined (BOOST_MSVC)
|
#if defined (BOOST_MSVC)
|
||||||
# pragma warning(push)
|
# pragma warning(push)
|
||||||
@ -48,6 +49,17 @@ namespace boost { namespace fusion
|
|||||||
pair(typename detail::call_param<Second>::type val)
|
pair(typename detail::call_param<Second>::type val)
|
||||||
: second(val) {}
|
: second(val) {}
|
||||||
|
|
||||||
|
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||||
|
|
||||||
|
BOOST_FUSION_GPU_ENABLED
|
||||||
|
template <typename Second2>
|
||||||
|
pair(Second2&& val
|
||||||
|
, typename boost::disable_if<is_lvalue_reference<Second2> >::type* /* dummy */ = 0
|
||||||
|
, typename boost::enable_if<is_convertible<Second2, Second> >::type* /*dummy*/ = 0
|
||||||
|
) : second(std::forward<Second>(val)) {}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
template <typename Second2>
|
template <typename Second2>
|
||||||
BOOST_FUSION_GPU_ENABLED
|
BOOST_FUSION_GPU_ENABLED
|
||||||
pair(pair<First, Second2> const& rhs)
|
pair(pair<First, Second2> const& rhs)
|
||||||
|
Reference in New Issue
Block a user