diff --git a/include/boost/fusion/container/list/list.hpp b/include/boost/fusion/container/list/list.hpp index d291baf9..865a6d7d 100644 --- a/include/boost/fusion/container/list/list.hpp +++ b/include/boost/fusion/container/list/list.hpp @@ -20,12 +20,12 @@ /////////////////////////////////////////////////////////////////////////////// // C++11 interface /////////////////////////////////////////////////////////////////////////////// +#include #include namespace boost { namespace fusion { struct nil_; - struct void_; template <> struct list<> @@ -40,6 +40,7 @@ namespace boost { namespace fusion list() : inherited_type() {} +#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) template BOOST_FUSION_GPU_ENABLED list(Sequence const& rhs) @@ -53,6 +54,21 @@ namespace boost { namespace fusion inherited_type::operator=(rhs); return *this; } +#else + template + BOOST_FUSION_GPU_ENABLED + list(Sequence&& rhs) + : inherited_type(std::forward(rhs)) {} + + template + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + list& + operator=(Sequence&& rhs) + { + inherited_type::operator=(std::forward(rhs)); + return *this; + } +#endif }; template @@ -68,30 +84,24 @@ namespace boost { namespace fusion list() : inherited_type() {} - template - BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED - list(list const& rhs) - : inherited_type(rhs) {} - +#if defined(BOOST_NO_CXX11_RVALUE_REFERENCES) template BOOST_FUSION_GPU_ENABLED list(Sequence const& rhs) : inherited_type(rhs) {} +#else + template + BOOST_FUSION_GPU_ENABLED + list(Sequence&& rhs) + : inherited_type(std::forward(rhs)) {} +#endif BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED explicit list(typename detail::call_param::type ...args) : inherited_type(list_to_cons::call(args...)) {} - template - BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED - list& - operator=(list const& rhs) - { - inherited_type::operator=(rhs); - return *this; - } - +#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) template BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED list& @@ -100,6 +110,16 @@ namespace boost { namespace fusion inherited_type::operator=(rhs); return *this; } +#else + template + BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED + list& + operator=(Sequence&& rhs) + { + inherited_type::operator=(std::forward(rhs)); + return *this; + } +#endif }; }}