|
4153 | 4153 |
|
4154 | 4154 | \begin{itemdescr}
|
4155 | 4155 | \pnum
|
4156 |
| -Let \tcode{U} be \tcode{invoke_result_t<F, decltype(value())>}. |
| 4156 | +Let \tcode{U} be \tcode{invoke_result_t<F, decltype(*val)>}. |
4157 | 4157 |
|
4158 | 4158 | \pnum
|
4159 | 4159 | \mandates
|
|
4164 | 4164 | Equivalent to:
|
4165 | 4165 | \begin{codeblock}
|
4166 | 4166 | if (*this) {
|
4167 |
| - return invoke(std::forward<F>(f), value()); |
| 4167 | + return invoke(std::forward<F>(f), *val); |
4168 | 4168 | } else {
|
4169 | 4169 | return remove_cvref_t<U>();
|
4170 | 4170 | }
|
|
4179 | 4179 |
|
4180 | 4180 | \begin{itemdescr}
|
4181 | 4181 | \pnum
|
4182 |
| -Let \tcode{U} be \tcode{invoke_result_t<F, decltype(std::move(value()))>}. |
| 4182 | +Let \tcode{U} be \tcode{invoke_result_t<F, decltype(std::move(*val))>}. |
4183 | 4183 |
|
4184 | 4184 | \pnum
|
4185 | 4185 | \mandates
|
|
4190 | 4190 | Equivalent to:
|
4191 | 4191 | \begin{codeblock}
|
4192 | 4192 | if (*this) {
|
4193 |
| - return invoke(std::forward<F>(f), std::move(value())); |
| 4193 | + return invoke(std::forward<F>(f), std::move(*val)); |
4194 | 4194 | } else {
|
4195 | 4195 | return remove_cvref_t<U>();
|
4196 | 4196 | }
|
|
4205 | 4205 |
|
4206 | 4206 | \begin{itemdescr}
|
4207 | 4207 | \pnum
|
4208 |
| -Let \tcode{U} be \tcode{remove_cv_t<invoke_result_t<F, decltype(value())>>}. |
| 4208 | +Let \tcode{U} be \tcode{remove_cv_t<invoke_result_t<F, decltype(*val)>>}. |
4209 | 4209 |
|
4210 | 4210 | \pnum
|
4211 | 4211 | \mandates
|
4212 | 4212 | \tcode{U} is a non-array object type
|
4213 | 4213 | other than \tcode{in_place_t} or \tcode{nullopt_t}.
|
4214 | 4214 | The declaration
|
4215 | 4215 | \begin{codeblock}
|
4216 |
| -U u(invoke(std::forward<F>(f), value())); |
| 4216 | +U u(invoke(std::forward<F>(f), *val)); |
4217 | 4217 | \end{codeblock}
|
4218 | 4218 | is well-formed for some invented variable \tcode{u}.
|
4219 | 4219 | \begin{note}
|
|
4224 | 4224 | \returns
|
4225 | 4225 | If \tcode{*this} contains a value, an \tcode{optional<U>} object
|
4226 | 4226 | whose contained value is direct-non-list-initialized with
|
4227 |
| -\tcode{invoke(std::forward<F>(f), value())}; |
| 4227 | +\tcode{invoke(std::forward<F>(f), *val)}; |
4228 | 4228 | otherwise, \tcode{optional<U>()}.
|
4229 | 4229 | \end{itemdescr}
|
4230 | 4230 |
|
|
4237 | 4237 | \begin{itemdescr}
|
4238 | 4238 | \pnum
|
4239 | 4239 | Let \tcode{U} be
|
4240 |
| -\tcode{remove_cv_t<invoke_result_t<F, decltype(std::move(value()))>>}. |
| 4240 | +\tcode{remove_cv_t<invoke_result_t<F, decltype(std::move(*val))>>}. |
4241 | 4241 |
|
4242 | 4242 | \pnum
|
4243 | 4243 | \mandates
|
4244 | 4244 | \tcode{U} is a non-array object type
|
4245 | 4245 | other than \tcode{in_place_t} or \tcode{nullopt_t}.
|
4246 | 4246 | The declaration
|
4247 | 4247 | \begin{codeblock}
|
4248 |
| -U u(invoke(std::forward<F>(f), std::move(value()))); |
| 4248 | +U u(invoke(std::forward<F>(f), std::move(*val))); |
4249 | 4249 | \end{codeblock}
|
4250 | 4250 | is well-formed for some invented variable \tcode{u}.
|
4251 | 4251 | \begin{note}
|
|
4256 | 4256 | \returns
|
4257 | 4257 | If \tcode{*this} contains a value, an \tcode{optional<U>} object
|
4258 | 4258 | whose contained value is direct-non-list-initialized with
|
4259 |
| -\tcode{invoke(std::forward<F>(f), std::move(value()))}; |
| 4259 | +\tcode{invoke(std::forward<F>(f), std::move(*val))}; |
4260 | 4260 | otherwise, \tcode{optional<U>()}.
|
4261 | 4261 | \end{itemdescr}
|
4262 | 4262 |
|
|
8368 | 8368 |
|
8369 | 8369 | \begin{itemdescr}
|
8370 | 8370 | \pnum
|
8371 |
| -Let \tcode{U} be \tcode{remove_cvref_t<invoke_result_t<F, decltype(**this)>>}. |
| 8371 | +Let \tcode{U} be \tcode{remove_cvref_t<invoke_result_t<F, decltype((\exposid{val}))>>}. |
8372 | 8372 |
|
8373 | 8373 | \pnum
|
8374 | 8374 | \constraints
|
|
8384 | 8384 | Equivalent to:
|
8385 | 8385 | \begin{codeblock}
|
8386 | 8386 | if (has_value())
|
8387 |
| - return invoke(std::forward<F>(f), **this); |
| 8387 | + return invoke(std::forward<F>(f), @\exposid{val}@); |
8388 | 8388 | else
|
8389 | 8389 | return U(unexpect, error());
|
8390 | 8390 | \end{codeblock}
|
|
8399 | 8399 | \begin{itemdescr}
|
8400 | 8400 | \pnum
|
8401 | 8401 | Let \tcode{U} be
|
8402 |
| -\tcode{remove_cvref_t<invoke_result_t<F, decltype(std::move(**this))>>}. |
| 8402 | +\tcode{remove_cvref_t<invoke_result_t<F, decltype(std::move(\exposid{val}))>>}. |
8403 | 8403 |
|
8404 | 8404 | \pnum
|
8405 | 8405 | \constraints
|
|
8415 | 8415 | Equivalent to:
|
8416 | 8416 | \begin{codeblock}
|
8417 | 8417 | if (has_value())
|
8418 |
| - return invoke(std::forward<F>(f), std::move(**this)); |
| 8418 | + return invoke(std::forward<F>(f), std::move(@\exposid{val}@)); |
8419 | 8419 | else
|
8420 | 8420 | return U(unexpect, std::move(error()));
|
8421 | 8421 | \end{codeblock}
|
|
8433 | 8433 |
|
8434 | 8434 | \pnum
|
8435 | 8435 | \constraints
|
8436 |
| -\tcode{is_constructible_v<T, decltype(**this)>} is \tcode{true}. |
| 8436 | +\tcode{is_constructible_v<T, decltype((\exposid{val}))>} is \tcode{true}. |
8437 | 8437 |
|
8438 | 8438 | \pnum
|
8439 | 8439 | \mandates
|
|
8445 | 8445 | Equivalent to:
|
8446 | 8446 | \begin{codeblock}
|
8447 | 8447 | if (has_value())
|
8448 |
| - return G(in_place, **this); |
| 8448 | + return G(in_place, @\exposid{val}@); |
8449 | 8449 | else
|
8450 | 8450 | return invoke(std::forward<F>(f), error());
|
8451 | 8451 | \end{codeblock}
|
|
8464 | 8464 |
|
8465 | 8465 | \pnum
|
8466 | 8466 | \constraints
|
8467 |
| -\tcode{is_constructible_v<T, decltype(std::move(**this))>} is \tcode{true}. |
| 8467 | +\tcode{is_constructible_v<T, decltype(std::move(\exposid{val}))>} is \tcode{true}. |
8468 | 8468 |
|
8469 | 8469 | \pnum
|
8470 | 8470 | \mandates
|
|
8476 | 8476 | Equivalent to:
|
8477 | 8477 | \begin{codeblock}
|
8478 | 8478 | if (has_value())
|
8479 |
| - return G(in_place, std::move(**this)); |
| 8479 | + return G(in_place, std::move(@\exposid{val}@)); |
8480 | 8480 | else
|
8481 | 8481 | return invoke(std::forward<F>(f), std::move(error()));
|
8482 | 8482 | \end{codeblock}
|
|
8491 | 8491 | \begin{itemdescr}
|
8492 | 8492 | \pnum
|
8493 | 8493 | Let \tcode{U} be
|
8494 |
| -\tcode{remove_cv_t<invoke_result_t<F, decltype(**this)>>}. |
| 8494 | +\tcode{remove_cv_t<invoke_result_t<F, decltype((\exposid{val}))>>}. |
8495 | 8495 |
|
8496 | 8496 | \pnum
|
8497 | 8497 | \constraints
|
|
8503 | 8503 | If \tcode{is_void_v<U>} is \tcode{false},
|
8504 | 8504 | the declaration
|
8505 | 8505 | \begin{codeblock}
|
8506 |
| -U u(invoke(std::forward<F>(f), **this)); |
| 8506 | +U u(invoke(std::forward<F>(f), @\exposid{val}@)); |
8507 | 8507 | \end{codeblock}
|
8508 | 8508 | is well-formed.
|
8509 | 8509 |
|
|
8517 | 8517 | Otherwise, if \tcode{is_void_v<U>} is \tcode{false}, returns an
|
8518 | 8518 | \tcode{expected<U, E>} object whose \exposid{has_val} member is \tcode{true}
|
8519 | 8519 | and \exposid{val} member is direct-non-list-initialized with
|
8520 |
| -\tcode{invoke(std::forward<F>(f), **this)}. |
| 8520 | +\tcode{invoke(std::forward<F>(f), \exposid{val})}. |
8521 | 8521 | \item
|
8522 |
| -Otherwise, evaluates \tcode{invoke(std::forward<F>(f), **this)} and then |
| 8522 | +Otherwise, evaluates \tcode{invoke(std::forward<F>(f), \exposid{val})} and then |
8523 | 8523 | returns \tcode{expected<U, E>()}.
|
8524 | 8524 | \end{itemize}
|
8525 | 8525 | \end{itemdescr}
|
|
8533 | 8533 | \begin{itemdescr}
|
8534 | 8534 | \pnum
|
8535 | 8535 | Let \tcode{U} be
|
8536 |
| -\tcode{remove_cv_t<invoke_result_t<F, decltype(std::move(**this))>>}. |
| 8536 | +\tcode{remove_cv_t<invoke_result_t<F, decltype(std::move(\exposid{val}))>>}. |
8537 | 8537 |
|
8538 | 8538 | \pnum
|
8539 | 8539 | \constraints
|
|
8544 | 8544 | \tcode{U} is a valid value type for \tcode{expected}. If \tcode{is_void_v<U>} is
|
8545 | 8545 | \tcode{false}, the declaration
|
8546 | 8546 | \begin{codeblock}
|
8547 |
| -U u(invoke(std::forward<F>(f), std::move(**this))); |
| 8547 | +U u(invoke(std::forward<F>(f), std::move(@\exposid{val}@))); |
8548 | 8548 | \end{codeblock}
|
8549 | 8549 | is well-formed.
|
8550 | 8550 |
|
|
8558 | 8558 | Otherwise, if \tcode{is_void_v<U>} is \tcode{false}, returns an
|
8559 | 8559 | \tcode{expected<U, E>} object whose \exposid{has_val} member is \tcode{true}
|
8560 | 8560 | and \exposid{val} member is direct-non-list-initialized with
|
8561 |
| -\tcode{invoke(std::forward<F>(f), std::move(**this))}. |
| 8561 | +\tcode{invoke(std::forward<F>(f), std::move(\exposid{val}))}. |
8562 | 8562 | \item
|
8563 |
| -Otherwise, evaluates \tcode{invoke(std::forward<F>(f), std::move(**this))} and |
| 8563 | +Otherwise, evaluates \tcode{invoke(std::forward<F>(f), std::move(\exposid{val}))} and |
8564 | 8564 | then returns \tcode{ex\-pected<U, E>()}.
|
8565 | 8565 | \end{itemize}
|
8566 | 8566 | \end{itemdescr}
|
|
8577 | 8577 |
|
8578 | 8578 | \pnum
|
8579 | 8579 | \constraints
|
8580 |
| -\tcode{is_constructible_v<T, decltype(**this)>} is \tcode{true}. |
| 8580 | +\tcode{is_constructible_v<T, decltype((\exposid{val}))>} is \tcode{true}. |
8581 | 8581 |
|
8582 | 8582 | \pnum
|
8583 | 8583 | \mandates
|
|
8591 | 8591 | \pnum
|
8592 | 8592 | \returns
|
8593 | 8593 | If \tcode{has_value()} is \tcode{true},
|
8594 |
| -\tcode{expected<T, G>(in_place, **this)}; otherwise, an \tcode{expected<T, G>} |
| 8594 | +\tcode{expected<T, G>(in_place, \exposid{val})}; otherwise, an \tcode{expected<T, G>} |
8595 | 8595 | object whose \exposid{has_val} member is \tcode{false} and \exposid{unex} member
|
8596 | 8596 | is direct-non-list-initialized with \tcode{invoke(std::forward<F>(f), error())}.
|
8597 | 8597 | \end{itemdescr}
|
|
8609 | 8609 |
|
8610 | 8610 | \pnum
|
8611 | 8611 | \constraints
|
8612 |
| -\tcode{is_constructible_v<T, decltype(std::move(**this))>} is \tcode{true}. |
| 8612 | +\tcode{is_constructible_v<T, decltype(std::move(\exposid{val}))>} is \tcode{true}. |
8613 | 8613 |
|
8614 | 8614 | \pnum
|
8615 | 8615 | \mandates
|
|
8623 | 8623 | \pnum
|
8624 | 8624 | \returns
|
8625 | 8625 | If \tcode{has_value()} is \tcode{true},
|
8626 |
| -\tcode{expected<T, G>(in_place, std::move(**this))}; otherwise, an |
| 8626 | +\tcode{expected<T, G>(in_place, std::move(\exposid{val}))}; otherwise, an |
8627 | 8627 | \tcode{expected<T, G>} object whose \exposid{has_val} member is \tcode{false}
|
8628 | 8628 | and \exposid{unex} member is direct-non-list-initialized with
|
8629 | 8629 | \tcode{invoke(std::forward<F>(f), std::move(error()))}.
|
|
0 commit comments