mirror of
https://github.com/boostorg/optional.git
synced 2025-07-29 12:07:21 +02:00
Fix make_optional for rvalues
This commit is contained in:
@ -1097,6 +1097,15 @@ template<class T> void foo ( optional<T> const& opt ) ;
|
||||
foo ( make_optional(1+1) ) ; // Creates an optional<int>
|
||||
``
|
||||
|
||||
__SPACE__
|
||||
|
||||
[#reference_make_optional_rvalue]
|
||||
|
||||
[: `optional<std::decay_t<T>> make_optional( T && v )`]
|
||||
|
||||
* [*Returns: ] `optional<std::decay_t<T>>(std::move(v))` for the ['deduced] type `T` of `v`.
|
||||
|
||||
|
||||
__SPACE__
|
||||
|
||||
[#reference_make_optional_bool_value]
|
||||
@ -1117,6 +1126,15 @@ if ( !v )
|
||||
error("foo wasn't computed");
|
||||
``
|
||||
|
||||
__SPACE__
|
||||
|
||||
[#reference_make_optional_bool_rvalue]
|
||||
|
||||
[: `optional<std::decay_t<T>> make_optional( bool condition, T && v )`]
|
||||
|
||||
* [*Returns: ] `optional<std::decay_t<T>>(condition, std::move(v))` for the ['deduced] type `T` of `v`.
|
||||
|
||||
|
||||
__SPACE__
|
||||
|
||||
[#reference_operator_compare_equal_optional_optional]
|
||||
|
Reference in New Issue
Block a user