mirror of
https://github.com/boostorg/fusion.git
synced 2025-07-29 12:07:36 +02:00
Added move functions for set.
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
/*=============================================================================
|
/*=============================================================================
|
||||||
Copyright (c) 2014 Kohei Takahashi
|
Copyright (c) 2014-2015 Kohei Takahashi
|
||||||
|
|
||||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
Distributed under 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)
|
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
@ -100,11 +100,26 @@ namespace boost { namespace fusion
|
|||||||
set(Sequence const& rhs)
|
set(Sequence const& rhs)
|
||||||
: data(rhs) {}
|
: data(rhs) {}
|
||||||
|
|
||||||
|
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||||
|
template <typename Sequence>
|
||||||
|
BOOST_FUSION_GPU_ENABLED
|
||||||
|
set(Sequence&& rhs)
|
||||||
|
: data(std::forward<Sequence>(rhs)) {}
|
||||||
|
#endif
|
||||||
|
|
||||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||||
explicit
|
explicit
|
||||||
set(typename detail::call_param<T>::type ...args)
|
set(typename detail::call_param<T>::type ...args)
|
||||||
: data(args...) {}
|
: data(args...) {}
|
||||||
|
|
||||||
|
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||||
|
template <typename ...U>
|
||||||
|
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||||
|
explicit
|
||||||
|
set(U&& ...args)
|
||||||
|
: data(std::forward<U>(args)...) {}
|
||||||
|
#endif
|
||||||
|
|
||||||
template <typename U>
|
template <typename U>
|
||||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||||
set&
|
set&
|
||||||
@ -114,6 +129,17 @@ namespace boost { namespace fusion
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||||
|
template <typename U>
|
||||||
|
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||||
|
set&
|
||||||
|
operator=(U&& rhs)
|
||||||
|
{
|
||||||
|
data = std::forward<U>(rhs);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||||
storage_type& get_data() { return data; }
|
storage_type& get_data() { return data; }
|
||||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||||
|
Reference in New Issue
Block a user