template<class F> constexpr auto and_then(F&& f) &; template<class F> constexpr auto and_then(F&& f) const &;
-1- Let
-2- […] -3- […] -4- Effects: Equivalent to:U
beremove_cvref_t<invoke_result_t<F, decltype( **this (val))>>
.if (has_value()) return invoke(std::forward<F>(f), **thisval); else return U(unexpect, error());
template<class F> constexpr auto and_then(F&& f) &&; template<class F> constexpr auto and_then(F&& f) const &&;
-5- Let
-6- […] -7- […] -8- Effects: Equivalent to:U
beremove_cvref_t<invoke_result_t<F, decltype((std::move( **this val))>>
.if (has_value()) return invoke(std::forward<F>(f), std::move(**thisval)); else return U(unexpect, std::move(error()));
template<class F> constexpr auto or_else(F&& f) &; template<class F> constexpr auto or_else(F&& f) const &;
-9- Let
-10- Constraints:G
beremove_cvref_t<invoke_result_t<F, decltype(error())>>
.is_constructible_v<T, decltype( **this (val))>
istrue
. -11- […] -12- Effects: Equivalent to:if (has_value()) return G(in_place, **thisval); else return invoke(std::forward<F>(f), error());
template<class F> constexpr auto or_else(F&& f) &&; template<class F> constexpr auto or_else(F&& f) const &&;
-13- Let
-14- Constraints:G
beremove_cvref_t<invoke_result_t<F, decltype(std::move(error()))>>
.is_constructible_v<T, decltype(std::move( **this val))>
istrue
. -15- […] -16- Effects: Equivalent to:if (has_value()) return G(in_place, std::move(**thisval)); else return invoke(std::forward<F>(f), std::move(error()));
template<class F> constexpr auto transform(F&& f) &; template<class F> constexpr auto transform(F&& f) const &;
-17- Let
-18- […] -19- Mandates:U
beremove_cvref_t<invoke_result_t<F, decltype( **this (val))>>
.U
is a valid value type forexpected
. Ifis_void_v<U>
isfalse
, the declarationU u(invoke(std::forward<F>(f), **thisval));is well-formed.
-20- Effects:
(20.1) — […]
(20.2) — Otherwise, if
is_void_v<U>
isfalse
, returns anexpected<U, E>
object whosehas_val
member istrue
andval
member is direct-non-list-initialized withinvoke(std::forward<F>(f), **this val)
.(20.3) — Otherwise, evaluates
invoke(std::forward<F>(f), **this val)
and then returnsexpected<U, E>()
.
template<class F> constexpr auto transform(F&& f) &&; template<class F> constexpr auto transform(F&& f) const &&;
-21- Let
-22- […] -23- Mandates:U
beremove_cvref_t<invoke_result_t<F, decltype(std::move( **this val))>>
.U
is a valid value type forexpected
. Ifis_void_v<U>
isfalse
, the declarationU u(invoke(std::forward<F>(f), std::move(**thisval)));is well-formed.
-24- Effects:
(24.1) — […]
(24.2) — Otherwise, if
is_void_v<U>
isfalse
, returns anexpected<U, E>
object whosehas_val
member istrue
andval
member is direct-non-list-initialized withinvoke(std::forward<F>(f), std::move( **this val))
.(24.3) — Otherwise, evaluates
invoke(std::forward<F>(f), std::move( **this val))
and then returnsexpected<U, E>()
.
template<class F> constexpr auto transform_error(F&& f) &; template<class F> constexpr auto transform_error(F&& f) const &;
-25- Let
-26- Constraints:G
beremove_cvref_t<invoke_result_t<F, decltype(error())>>
.is_constructible_v<T, decltype( **this (val))>
istrue
. -27- Mandates: […] -28- Returns: Ifhas_value()
istrue
,expected<T, G>(in_place, **this val)
; otherwise, anexpected<T, G>
object whosehas_val
member isfalse
andunex
member is direct-non-list-initialized withinvoke(std::forward<F>(f), error())
.
template<class F> constexpr auto transform_error(F&& f) &&; template<class F> constexpr auto transform_error(F&& f) const &&;
-29- Let
-30- Constraints:G
beremove_cvref_t<invoke_result_t<F, decltype(std::move(error()))>>
.is_constructible_v<T, decltype(std::move( **this val))>
istrue
. -31- Mandates: […] -32- Returns: Ifhas_value()
istrue
,expected<T, G>(in_place, std::move( **this val))
; otherwise, anexpected<T, G>
object whosehas_val
member isfalse
andunex
member is direct-non-list-initialized withinvoke(std::forward<F>(f), std::move(error()))
.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4