From 86e759fb899eada4f2875df21c2a9743cb30a86b Mon Sep 17 00:00:00 2001 From: Andrzej Krzemienski Date: Fri, 2 May 2014 18:41:23 +0200 Subject: [PATCH] optional::rval_reference_type is now T&& (not const T&) --- include/boost/optional/optional.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/boost/optional/optional.hpp b/include/boost/optional/optional.hpp index 33f4374..0a01141 100644 --- a/include/boost/optional/optional.hpp +++ b/include/boost/optional/optional.hpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -161,7 +162,7 @@ struct types_when_is_ref typedef raw_type& reference_const_type ; typedef raw_type& reference_type ; #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES - typedef raw_type&& rval_reference_type ; + typedef BOOST_DEDUCED_TYPENAME remove_const::type&& rval_reference_type ; static reference_type move(reference_type r) { return r; } #endif typedef raw_type* pointer_const_type ; @@ -880,6 +881,7 @@ class optional : public optional_detail::optional_base // Assigns from a T (deep-moves the rhs value) optional& operator= ( rval_reference_type val ) { + optional_detail::prevent_binding_rvalue_ref_to_optional_lvalue_ref(); this->assign( boost::move(val) ) ; return *this ; }