mirror of
https://github.com/boostorg/optional.git
synced 2025-07-29 12:07:21 +02:00
test and doc update for .map()
This commit is contained in:
@ -687,20 +687,20 @@ __SPACE__
|
||||
|
||||
[#reference_optional_map]
|
||||
|
||||
[: `template<class F> auto optional<T>::map(F f) const& -> ``['see below]`` ;`]
|
||||
[: `template<class F> auto optional<T>::map(F f) & -> ``['see below]`` ;`]
|
||||
[: `template<class F> auto optional<T>::map(F f) const& -> `['see below]` ;`]
|
||||
[: `template<class F> auto optional<T>::map(F f) & -> `['see below]` ;`]
|
||||
|
||||
* [*Effects:] `if (*this) return f(**this); else return none;`
|
||||
* [*Notes:] The return type of these overloads is `optional<decltype(f(**this)>`. On compilers that do not support ref-qualifiers on member functions, these two (as well as the next one) overloads are replaced with good old const and non-const overloads.
|
||||
* [*Notes:] The return type of these overloads is `optional<decltype(f(**this))>`. On compilers that do not support ref-qualifiers on member functions, these two (as well as the next one) overloads are replaced with good old const and non-const overloads.
|
||||
|
||||
__SPACE__
|
||||
|
||||
[#reference_optional_map_move]
|
||||
|
||||
[: `template<class F> auto optional<T>::map(F f) && -> ``['see below]`` ;`]
|
||||
[: `template<class F> auto optional<T>::map(F f) && -> `['see below]` ;`]
|
||||
|
||||
* [*Effects:] `if (*this) return f(std::move(**this)); else return none;`
|
||||
* [*Notes:] The return type of this overload is `optional<decltype(f(istd::move(**this))>`.
|
||||
* [*Notes:] The return type of this overload is `optional<decltype(f(istd::move(**this)))>`.
|
||||
|
||||
__SPACE__
|
||||
|
||||
@ -1053,6 +1053,13 @@ __SPACE__
|
||||
|
||||
__SPACE__
|
||||
|
||||
[#reference_optional_ref_map]
|
||||
[: `template<class F> auto optional<T&>::map( F f ) const -> `['see below]`;`]
|
||||
* [*Effects:] Equivalent to `if (*this) return f(**this); else return none;`.
|
||||
* [*Remarks:] The return type of this function is `optional<decltype(f(**this))>`.
|
||||
|
||||
__SPACE__
|
||||
|
||||
[#reference_optional_ref_get_ptr]
|
||||
[: `T* optional<T&>::get_ptr () const noexcept;`]
|
||||
* [*Returns:] `ref`.
|
||||
|
Reference in New Issue
Block a user