mirror of
https://github.com/boostorg/fusion.git
synced 2025-07-23 17:17:23 +02:00
R-value references are now container-wide requirements.
This commit is contained in:
@ -19,6 +19,9 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <boost/fusion/support/detail/as_fusion_element.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
#include <utility>
|
||||
|
||||
namespace boost { namespace fusion
|
||||
{
|
||||
@ -27,16 +30,22 @@ namespace boost { namespace fusion
|
||||
template <typename ...T>
|
||||
struct make_set
|
||||
{
|
||||
typedef set<typename detail::as_fusion_element<T>::type...> type;
|
||||
typedef set<
|
||||
typename detail::as_fusion_element<
|
||||
typename remove_const<
|
||||
typename remove_reference<T>::type
|
||||
>::type
|
||||
>::type...
|
||||
> type;
|
||||
};
|
||||
}
|
||||
|
||||
template <typename ...T>
|
||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
inline typename result_of::make_set<T...>::type
|
||||
make_set(T const&... arg)
|
||||
make_set(T&&... arg)
|
||||
{
|
||||
return typename result_of::make_set<T...>::type(arg...);
|
||||
return typename result_of::make_set<T...>::type(std::forward<T>(arg)...);
|
||||
}
|
||||
}}
|
||||
|
||||
|
@ -95,41 +95,22 @@ namespace boost { namespace fusion
|
||||
set()
|
||||
: data() {}
|
||||
|
||||
template <typename Sequence>
|
||||
BOOST_FUSION_GPU_ENABLED
|
||||
set(Sequence const& 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
|
||||
explicit
|
||||
set(typename detail::call_param<T>::type ...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>
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
set&
|
||||
operator=(U const& rhs)
|
||||
{
|
||||
data = rhs;
|
||||
return *this;
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
template <typename U>
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
set&
|
||||
@ -138,7 +119,6 @@ namespace boost { namespace fusion
|
||||
data = std::forward<U>(rhs);
|
||||
return *this;
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||
storage_type& get_data() { return data; }
|
||||
|
Reference in New Issue
Block a user