From 3613310b6233cb70286968570fc3ba436ae4e3b3 Mon Sep 17 00:00:00 2001 From: Joel de Guzman Date: Fri, 31 Aug 2012 15:58:31 +0000 Subject: [PATCH] deque move-ctor OK on gcc [SVN r80334] --- .../boost/fusion/container/deque/deque.hpp | 26 +++++++++++++------ .../deque/detail/cpp11_deque_keyed_values.hpp | 16 +++++++++--- .../container/deque/detail/keyed_element.hpp | 3 +++ 3 files changed, 34 insertions(+), 11 deletions(-) diff --git a/include/boost/fusion/container/deque/deque.hpp b/include/boost/fusion/container/deque/deque.hpp index 5ebf03d9..4920e847 100644 --- a/include/boost/fusion/container/deque/deque.hpp +++ b/include/boost/fusion/container/deque/deque.hpp @@ -71,6 +71,11 @@ namespace boost { namespace fusion : base(seq) {} + template + deque(deque& seq) + : base(seq) + {} + #if !defined(BOOST_NO_RVALUE_REFERENCES) template deque(deque&& seq) @@ -89,16 +94,21 @@ namespace boost { namespace fusion #endif explicit deque(Head const& head, Tail const&... tail) - : base(detail::deque_keyed_values::call(head, tail...)) + : base(detail::deque_keyed_values::construct(head, tail...)) {} -//~ #if !defined(BOOST_NO_RVALUE_REFERENCES) - //~ template - //~ explicit deque(Head_&& head, Tail_&&... tail) - //~ : base(detail::deque_keyed_values - //~ ::call(std::forward(head), std::forward(tail)...)) - //~ {} -//~ #endif + template + explicit deque(Head_ const& head, Tail_ const&... tail) + : base(detail::deque_keyed_values::construct(head, tail...)) + {} + +#if !defined(BOOST_NO_RVALUE_REFERENCES) + template + explicit deque(Head_&& head, Tail_&&... tail) + : base(detail::deque_keyed_values + ::forward_(std::forward(head), std::forward(tail)...)) + {} +#endif template explicit deque(Sequence const& seq diff --git a/include/boost/fusion/container/deque/detail/cpp11_deque_keyed_values.hpp b/include/boost/fusion/container/deque/detail/cpp11_deque_keyed_values.hpp index 43ed5360..dd57b3a4 100644 --- a/include/boost/fusion/container/deque/detail/cpp11_deque_keyed_values.hpp +++ b/include/boost/fusion/container/deque/detail/cpp11_deque_keyed_values.hpp @@ -28,13 +28,22 @@ namespace boost { namespace fusion { namespace detail typedef typename deque_keyed_values_impl::type tail; typedef keyed_element type; - static type call( + static type construct( typename detail::call_param::type head , typename detail::call_param::type... tail) { return type( head - , deque_keyed_values_impl::call(tail...) + , deque_keyed_values_impl::construct(tail...) + ); + } + + static type forward_(Head&& head, Tail&&... tail) + { + return type( + std::forward(head) + , deque_keyed_values_impl:: + forward_(std::forward(tail)...) ); } }; @@ -45,7 +54,8 @@ namespace boost { namespace fusion { namespace detail struct deque_keyed_values_impl { typedef nil_keyed_element type; - static type call() { return type(); } + static type construct() { return type(); } + static type forward_() { return type(); } }; template diff --git a/include/boost/fusion/container/deque/detail/keyed_element.hpp b/include/boost/fusion/container/deque/detail/keyed_element.hpp index d8f988a5..2123b107 100644 --- a/include/boost/fusion/container/deque/detail/keyed_element.hpp +++ b/include/boost/fusion/container/deque/detail/keyed_element.hpp @@ -63,6 +63,9 @@ namespace boost { namespace fusion { namespace detail : Rest(rhs.get_base()), value_(rhs.value_) {} +#if !defined(BOOST_NO_RVALUE_REFERENCES) +#endif + Rest& get_base() { return *this;