Fix make_optional for rvalues

This commit is contained in:
Andrzej Krzemienski
2017-05-18 01:09:31 +02:00
parent c695be11b5
commit 4fe57f57fa
48 changed files with 280 additions and 44 deletions

View File

@ -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]