test and doc update for .map()

This commit is contained in:
Andrzej Krzemienski
2018-06-23 20:53:16 +02:00
parent e47a017009
commit 51d1bc843d
7 changed files with 67 additions and 11 deletions

View File

@ -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`.