mirror of
https://github.com/boostorg/fusion.git
synced 2025-07-25 01:57:15 +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/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
|
namespace boost { namespace fusion
|
||||||
{
|
{
|
||||||
@ -27,16 +30,22 @@ namespace boost { namespace fusion
|
|||||||
template <typename ...T>
|
template <typename ...T>
|
||||||
struct make_set
|
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>
|
template <typename ...T>
|
||||||
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||||
inline typename result_of::make_set<T...>::type
|
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()
|
set()
|
||||||
: data() {}
|
: data() {}
|
||||||
|
|
||||||
template <typename Sequence>
|
|
||||||
BOOST_FUSION_GPU_ENABLED
|
|
||||||
set(Sequence const& rhs)
|
|
||||||
: data(rhs) {}
|
|
||||||
|
|
||||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
|
||||||
template <typename Sequence>
|
template <typename Sequence>
|
||||||
BOOST_FUSION_GPU_ENABLED
|
BOOST_FUSION_GPU_ENABLED
|
||||||
set(Sequence&& rhs)
|
set(Sequence&& rhs)
|
||||||
: data(std::forward<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>
|
template <typename ...U>
|
||||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||||
explicit
|
explicit
|
||||||
set(U&& ...args)
|
set(U&& ...args)
|
||||||
: data(std::forward<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>
|
template <typename U>
|
||||||
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
||||||
set&
|
set&
|
||||||
@ -138,7 +119,6 @@ namespace boost { namespace fusion
|
|||||||
data = std::forward<U>(rhs);
|
data = std::forward<U>(rhs);
|
||||||
return *this;
|
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; }
|
||||||
|
Reference in New Issue
Block a user