From 705ca2b61bfd2f4cfee693a3d8311b19bc2ae60d Mon Sep 17 00:00:00 2001 From: Joel de Guzman Date: Sat, 1 Sep 2012 01:04:12 +0000 Subject: [PATCH] move-assign for deque [SVN r80344] --- .../boost/fusion/container/deque/deque.hpp | 17 ++++++++++++++++ .../container/deque/detail/cpp03_deque.hpp | 20 +++++++++++++++++++ .../container/deque/detail/keyed_element.hpp | 17 ++++++++++++++++ 3 files changed, 54 insertions(+) diff --git a/include/boost/fusion/container/deque/deque.hpp b/include/boost/fusion/container/deque/deque.hpp index 4920e847..fe3754d2 100644 --- a/include/boost/fusion/container/deque/deque.hpp +++ b/include/boost/fusion/container/deque/deque.hpp @@ -129,6 +129,23 @@ namespace boost { namespace fusion base::operator=(rhs); return *this; } + +#if !defined(BOOST_NO_RVALUE_REFERENCES) + template + deque& operator=(deque&& rhs) + { + base::operator=(std::forward>(rhs)); + return *this; + } + + template + deque& operator=(T&& rhs) + { + base::operator=(std::forward(rhs)); + return *this; + } +#endif + }; }} diff --git a/include/boost/fusion/container/deque/detail/cpp03_deque.hpp b/include/boost/fusion/container/deque/detail/cpp03_deque.hpp index 19629fcc..36832b57 100644 --- a/include/boost/fusion/container/deque/detail/cpp03_deque.hpp +++ b/include/boost/fusion/container/deque/detail/cpp03_deque.hpp @@ -133,6 +133,26 @@ namespace boost { namespace fusion { base::operator=(rhs); return *this; } + +#if !defined(BOOST_NO_RVALUE_REFERENCES) + template + deque& + operator=(deque&& rhs) + { + base::operator=(std::forward< + deque>(rhs)); + return *this; + } + + template + deque& + operator=(T&& rhs) + { + base::operator=(std::forward(rhs)); + return *this; + } +#endif + }; }} diff --git a/include/boost/fusion/container/deque/detail/keyed_element.hpp b/include/boost/fusion/container/deque/detail/keyed_element.hpp index 2123b107..f6250748 100644 --- a/include/boost/fusion/container/deque/detail/keyed_element.hpp +++ b/include/boost/fusion/container/deque/detail/keyed_element.hpp @@ -123,6 +123,23 @@ namespace boost { namespace fusion { namespace detail return *this; } +#if !defined(BOOST_NO_RVALUE_REFERENCES) + template + keyed_element& operator=(keyed_element&& rhs) + { + base::operator=(std::forward>(rhs)); + value_ = std::forward(rhs.value_); + return *this; + } + + keyed_element& operator=(keyed_element&& rhs) + { + base::operator=(std::forward(rhs)); + value_ = std::forward(rhs.value_); + return *this; + } +#endif + Value value_; };