move-assign for deque

[SVN r80344]
This commit is contained in:
Joel de Guzman
2012-09-01 01:04:12 +00:00
parent e587ad4d50
commit 705ca2b61b
3 changed files with 54 additions and 0 deletions

View File

@ -129,6 +129,23 @@ namespace boost { namespace fusion
base::operator=(rhs); base::operator=(rhs);
return *this; return *this;
} }
#if !defined(BOOST_NO_RVALUE_REFERENCES)
template <typename ...Elements>
deque& operator=(deque<Elements...>&& rhs)
{
base::operator=(std::forward<deque<Elements...>>(rhs));
return *this;
}
template <typename T>
deque& operator=(T&& rhs)
{
base::operator=(std::forward<T>(rhs));
return *this;
}
#endif
}; };
}} }}

View File

@ -133,6 +133,26 @@ namespace boost { namespace fusion {
base::operator=(rhs); base::operator=(rhs);
return *this; return *this;
} }
#if !defined(BOOST_NO_RVALUE_REFERENCES)
template <BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, typename U)>
deque&
operator=(deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)>&& rhs)
{
base::operator=(std::forward<
deque<BOOST_PP_ENUM_PARAMS(FUSION_MAX_DEQUE_SIZE, U)>>(rhs));
return *this;
}
template <typename T>
deque&
operator=(T&& rhs)
{
base::operator=(std::forward<T>(rhs));
return *this;
}
#endif
}; };
}} }}

View File

@ -123,6 +123,23 @@ namespace boost { namespace fusion { namespace detail
return *this; return *this;
} }
#if !defined(BOOST_NO_RVALUE_REFERENCES)
template<typename U, typename Rst>
keyed_element& operator=(keyed_element<Key, U, Rst>&& rhs)
{
base::operator=(std::forward<keyed_element<Key, U, Rst>>(rhs));
value_ = std::forward<U>(rhs.value_);
return *this;
}
keyed_element& operator=(keyed_element&& rhs)
{
base::operator=(std::forward<keyed_element>(rhs));
value_ = std::forward<Value>(rhs.value_);
return *this;
}
#endif
Value value_; Value value_;
}; };