diff --git a/include/boost/fusion/container/generation/make_set.hpp b/include/boost/fusion/container/generation/make_set.hpp index 7f98532b..cd8519e5 100644 --- a/include/boost/fusion/container/generation/make_set.hpp +++ b/include/boost/fusion/container/generation/make_set.hpp @@ -19,6 +19,9 @@ /////////////////////////////////////////////////////////////////////////////// #include +#include +#include +#include namespace boost { namespace fusion { @@ -27,16 +30,22 @@ namespace boost { namespace fusion template struct make_set { - typedef set::type...> type; + typedef set< + typename detail::as_fusion_element< + typename remove_const< + typename remove_reference::type + >::type + >::type... + > type; }; } template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline typename result_of::make_set::type - make_set(T const&... arg) + make_set(T&&... arg) { - return typename result_of::make_set::type(arg...); + return typename result_of::make_set::type(std::forward(arg)...); } }} diff --git a/include/boost/fusion/container/set/set.hpp b/include/boost/fusion/container/set/set.hpp index 0d93290b..12fd8115 100644 --- a/include/boost/fusion/container/set/set.hpp +++ b/include/boost/fusion/container/set/set.hpp @@ -23,6 +23,8 @@ #include #include #include +#include +#include #include #include #include @@ -31,8 +33,8 @@ #include #include #include -#include #include +#include namespace boost { namespace fusion { @@ -57,7 +59,9 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED - set(Sequence const& rhs) + set(Sequence const& rhs, + typename enable_if >::type* = 0, + typename enable_if >::type* = 0) : data(rhs) {} template @@ -97,39 +101,17 @@ namespace boost { namespace fusion template BOOST_FUSION_GPU_ENABLED - set(Sequence const& rhs) - : data(rhs) {} - -#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) - template - BOOST_FUSION_GPU_ENABLED - set(Sequence&& rhs) + set(Sequence&& rhs, + typename enable_if >::type* = 0, + typename enable_if >::type* = 0) : data(std::forward(rhs)) {} -#endif - BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - explicit - set(typename detail::call_param::type ...args) - : data(args...) {} - -#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) template - BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit set(U&& ...args) : data(std::forward(args)...) {} -#endif - template - BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED - set& - operator=(U const& rhs) - { - data = rhs; - return *this; - } - -#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) template BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED set& @@ -138,7 +120,6 @@ namespace boost { namespace fusion data = std::forward(rhs); return *this; } -#endif BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED storage_type& get_data() { return data; } diff --git a/include/boost/fusion/container/vector/vector.hpp b/include/boost/fusion/container/vector/vector.hpp index ab1c1f04..9c5032f9 100644 --- a/include/boost/fusion/container/vector/vector.hpp +++ b/include/boost/fusion/container/vector/vector.hpp @@ -66,12 +66,12 @@ namespace boost { namespace fusion template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline each_elem - dispatch( T const&... ) BOOST_NOEXCEPT { return each_elem(); } + dispatch(T const&...) BOOST_NOEXCEPT { return each_elem(); } template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED inline copy_or_move - dispatch( This const& ) BOOST_NOEXCEPT { return copy_or_move(); } + dispatch(This const&) BOOST_NOEXCEPT { return copy_or_move(); } template BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED @@ -82,7 +82,7 @@ namespace boost { namespace fusion , make_indices_from_seq >::type > - dispatch( Sequence const& ) BOOST_NOEXCEPT + dispatch(Sequence const&) BOOST_NOEXCEPT { return from_sequence::type>(); } diff --git a/include/boost/fusion/support/detail/is_same_size.hpp b/include/boost/fusion/support/detail/is_same_size.hpp new file mode 100644 index 00000000..b1bf7cde --- /dev/null +++ b/include/boost/fusion/support/detail/is_same_size.hpp @@ -0,0 +1,29 @@ +/*============================================================================= + Copyright (c) 2014-2015 Kohei Takahashi + + 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) +==============================================================================*/ +#ifndef FUSION_IS_SAME_SIZE_10082015_1156 +#define FUSION_IS_SAME_SIZE_10082015_1156 + +#include +#include +#include +#include +#include + +namespace boost { namespace fusion { namespace detail +{ + template + struct is_same_size : mpl::false_ {}; + + template + struct is_same_size >::type, + typename enable_if >::type> + : mpl::equal_to, result_of::size > + {}; +}}} + +#endif