Closed SX91 closed 5 years ago
@martinmoene may I ask what's the point of constexpr value_type const && value() const
? It actually disables move-out of optional, isn't it?
Perhaps to provide a complete overload-set, see CppCon 2018: Titus Winters “Modern C++ Design (part 1 of 2)” @39.21, for several minutes.
rvalue version of
value_or
is currently defined like that:which causes compilation error due to an ambiguity.
Changing the signature to
optional_constexpr14 value_type value_or( U && v ) optional_refref_qual
fixes the issue.