|
6629 | 6629 | Direct-non-list-initializes
|
6630 | 6630 | \exposid{val} with \tcode{std::forward<Args>(args)...}.
|
6631 | 6631 |
|
| 6632 | +\pnum |
6632 | 6633 | \throws
|
6633 | 6634 | Any exception thrown by the initialization of \exposid{val}.
|
6634 | 6635 | \end{itemdescr}
|
|
6723 | 6724 | E& error() & noexcept;
|
6724 | 6725 | const E& error() const& noexcept;
|
6725 | 6726 | E&& error() && noexcept;
|
6726 |
| - const E&& error() const&& noexcept; |
| 6727 | + const E&& error() const&& noexcept; |
6727 | 6728 | private:
|
6728 | 6729 | E @\exposid{val}@; // \expos
|
6729 | 6730 | };
|
|
7002 | 7003 | \tcode{is_copy_constructible_v<E>} is \tcode{true}.
|
7003 | 7004 | \end{itemize}
|
7004 | 7005 |
|
| 7006 | +\pnum |
7005 | 7007 | This constructor is trivial if
|
7006 | 7008 | \begin{itemize}
|
7007 | 7009 | \item
|
|
7052 | 7054 | This constructor is trivial if
|
7053 | 7055 | \begin{itemize}
|
7054 | 7056 | \item
|
7055 |
| -is_trivially_move_constructible_v<T> is \tcode{true}; and |
| 7057 | +\tcode{is_trivially_move_constructible_v<T>} is \tcode{true}; and |
7056 | 7058 | \item
|
7057 |
| -is_trivially_move_constructible_v<E> is \tcode{true}. |
| 7059 | +\tcode{is_trivially_move_constructible_v<E>} is \tcode{true}. |
7058 | 7060 | \end{itemize}
|
7059 | 7061 | \end{itemdescr}
|
7060 | 7062 |
|
|
7465 | 7467 | is \tcode{true}.
|
7466 | 7468 | \end{itemize}
|
7467 | 7469 |
|
7468 |
| -\effects |
7469 | 7470 | \pnum
|
| 7471 | +\effects |
7470 | 7472 | \begin{itemize}
|
7471 | 7473 | \item
|
7472 | 7474 | If \tcode{has_value()} is \tcode{true},
|
|
7477 | 7479 | @\exposid{reinit-expected}@(@\exposid{val}@, @\exposid{unex}@, std::forward<U>(v));
|
7478 | 7480 | @\exposid{has_val}@ = true;
|
7479 | 7481 | \end{codeblock}
|
| 7482 | +\end{itemize} |
7480 | 7483 |
|
7481 | 7484 | \pnum
|
7482 | 7485 | \returns
|
7483 | 7486 | \tcode{*this}.
|
7484 |
| -\end{itemize} |
7485 | 7487 | \end{itemdescr}
|
7486 | 7488 |
|
7487 | 7489 | \indexlibrarymember{operator=}{expected}%
|
|
7511 | 7513 |
|
7512 | 7514 | \pnum
|
7513 | 7515 | \effects
|
7514 |
| -\pnum |
7515 | 7516 | \begin{itemize}
|
7516 | 7517 | \item
|
7517 | 7518 | If \tcode{has_value()} is \tcode{true}, equivalent to
|
|
7540 | 7541 | \constraints
|
7541 | 7542 | \tcode{is_nothrow_constructible_v<T, Args...>} is \tcode{true}.
|
7542 | 7543 |
|
| 7544 | +\pnum |
7543 | 7545 | \effects
|
7544 | 7546 | Equivalent to:
|
7545 | 7547 | \begin{codeblock}
|
|
7565 | 7567 | \tcode{is_nothrow_constructible_v<T, initializer_list<U>\&, Args...>}
|
7566 | 7568 | is \tcode{true}.
|
7567 | 7569 |
|
| 7570 | +\pnum |
7568 | 7571 | \effects
|
7569 | 7572 | Equivalent to:
|
7570 | 7573 | \begin{codeblock}
|
|
7724 | 7727 | \indexlibrarymember{operator bool}{expected}%
|
7725 | 7728 | \indexlibrarymember{has_value}{expected}%
|
7726 | 7729 | \begin{itemdecl}
|
7727 |
| -\pnum |
7728 | 7730 | constexpr explicit operator bool() const noexcept;
|
7729 | 7731 | constexpr bool has_value() const noexcept;
|
7730 | 7732 | \end{itemdecl}
|
|
7990 | 7992 | \begin{itemdescr}
|
7991 | 7993 | \pnum
|
7992 | 7994 | \effects
|
7993 |
| -If \tcode{rhs.has_value()} is \tcode{false} |
| 7995 | +If \tcode{rhs.has_value()} is \tcode{false}, |
7994 | 7996 | direct-non-list-initializes \exposid{unex} with \tcode{rhs.error()}.
|
7995 | 7997 |
|
7996 | 7998 | \pnum
|
|
8023 | 8025 |
|
8024 | 8026 | \pnum
|
8025 | 8027 | \effects
|
8026 |
| -If rhs.has_value() is \tcode{false}, |
| 8028 | +If \tcode{rhs.has_value()} is \tcode{false}, |
8027 | 8029 | direct-non-list-initializes \exposid{unex} with \tcode{std::move(rhs.error())}.
|
8028 | 8030 |
|
8029 | 8031 | \pnum
|
|
8153 | 8155 | \ensures
|
8154 | 8156 | \tcode{has_value()} is \tcode{false}.
|
8155 | 8157 |
|
| 8158 | +\pnum |
8156 | 8159 | \throws
|
8157 | 8160 | Any exception thrown by the initialization of \exposid{unex}.
|
8158 | 8161 | \end{itemdescr}
|
|
8360 | 8363 | rhs.@\exposid{has_val}@ = true;
|
8361 | 8364 | \end{codeblock}
|
8362 | 8365 |
|
| 8366 | +\pnum |
8363 | 8367 | \throws
|
8364 | 8368 | Any exception thrown by the expressions in the \effects.
|
8365 | 8369 |
|
| 8370 | +\pnum |
8366 | 8371 | \remarks
|
8367 | 8372 | The exception specification is
|
8368 | 8373 | \tcode{is_nothrow_move_constructible_v<E> \&\& is_nothrow_swappable_v<E>}.
|
|
8454 | 8459 | \expects
|
8455 | 8460 | \tcode{has_value()} is \tcode{false}.
|
8456 | 8461 |
|
| 8462 | +\pnum |
8457 | 8463 | \returns
|
8458 | 8464 | \tcode{std::move(\exposid{unex})}.
|
8459 | 8465 | \end{itemdescr}
|
|
8490 | 8496 | The expression \tcode{x.error() == e.value()} is well-formed and
|
8491 | 8497 | its result is convertible to \tcode{bool}.
|
8492 | 8498 |
|
| 8499 | +\pnum |
8493 | 8500 | \returns
|
8494 | 8501 | \tcode{!x.has_value() \&\& static_cast<bool>(x.error() == e.value())}.
|
8495 | 8502 | \end{itemdescr}
|
|
0 commit comments