result::value() correctly returns std::move(stored_), but operator* simply returns value(), which will always call the lref-qualified value(), and incorrectly attempt to bind the returned (lvalue reference) to an rvalue reference.
This change calls move(*this) for an rvalue call to value()
result::value()
correctly returnsstd::move(stored_)
, butoperator*
simply returnsvalue()
, which will always call the lref-qualifiedvalue()
, and incorrectly attempt to bind the returned (lvalue reference) to an rvalue reference.This change calls
move(*this)
for an rvalue call tovalue()