|
6634 | 6634 | Any exception thrown by the initialization of \exposid{val}.
|
6635 | 6635 | \end{itemdescr}
|
6636 | 6636 |
|
6637 |
| -\rSec4[expected.un.observe]{Observers} |
| 6637 | +\rSec4[expected.un.obs]{Observers} |
6638 | 6638 |
|
6639 | 6639 | \indexlibrarymember{value}{unexpected}%
|
6640 | 6640 | \begin{itemdecl}
|
|
6692 | 6692 | Equivalent to \tcode{x.swap(y)}.
|
6693 | 6693 | \end{itemdescr}
|
6694 | 6694 |
|
6695 |
| -\rSec4[expected.un.eq]{Equality operators} |
| 6695 | +\rSec4[expected.un.eq]{Equality operator} |
6696 | 6696 |
|
6697 | 6697 | \indexlibrarymember{operator==}{unexpected}%
|
6698 | 6698 | \begin{itemdecl}
|
|
6943 | 6943 | \pnum
|
6944 | 6944 | When \tcode{T} is not \cv{} \tcode{void}, it shall meet
|
6945 | 6945 | the \oldconcept{Destructible} requirements (\tref{cpp17.destructible}).
|
6946 |
| - |
6947 |
| -\pnum |
6948 | 6946 | \tcode{E} shall meet
|
6949 |
| -the \oldconcept{Destructible} requirements (\tref{cpp17.destructible}). |
| 6947 | +the \oldconcept{Destructible} requirements. |
6950 | 6948 |
|
6951 | 6949 | \rSec3[expected.object.ctor]{Constructors}
|
6952 | 6950 |
|
|
7054 | 7052 | This constructor is trivial if
|
7055 | 7053 | \begin{itemize}
|
7056 | 7054 | \item
|
7057 |
| -\tcode{is_trivially_move_constructible_v<T>} is \tcode{true}; and |
| 7055 | +\tcode{is_trivially_move_constructible_v<T>} is \tcode{true} and |
7058 | 7056 | \item
|
7059 | 7057 | \tcode{is_trivially_move_constructible_v<E>} is \tcode{true}.
|
7060 | 7058 | \end{itemize}
|
|
7323 | 7321 | This subclause makes use of the following exposition-only function:
|
7324 | 7322 | \begin{codeblock}
|
7325 | 7323 | template<class T, class U, class... Args>
|
7326 |
| -constexpr void @\exposid{reinit-expected}@(T& newval, U& oldval, Args&&... args) { |
| 7324 | +constexpr void @\exposid{reinit-expected}@(T& newval, U& oldval, Args&&... args) { // \expos |
7327 | 7325 | if constexpr (is_nothrow_constructible_v<T, Args...>) {
|
7328 | 7326 | destroy_at(addressof(oldval));
|
7329 | 7327 | construct_at(addressof(newval), std::forward<Args>(args)...);
|
|
7357 | 7355 | If \tcode{this->has_value() \&\& rhs.has_value()} is \tcode{true},
|
7358 | 7356 | equivalent to \tcode{\exposid{val} = *rhs}.
|
7359 | 7357 | \item
|
7360 |
| -Otherwise, if \tcode{this->has_value()} is \tcode{true}, equivalent to |
| 7358 | +Otherwise, if \tcode{this->has_value()} is \tcode{true}, equivalent to: |
7361 | 7359 | \begin{codeblock}
|
7362 | 7360 | @\exposid{reinit-expected}@(@\exposid{unex}@, @\exposid{val}@, rhs.error())
|
7363 | 7361 | \end{codeblock}
|
7364 | 7362 | \item
|
7365 |
| -Otherwise, if \tcode{rhs.has_value()} is \tcode{true}, equivalent to |
| 7363 | +Otherwise, if \tcode{rhs.has_value()} is \tcode{true}, equivalent to: |
7366 | 7364 | \begin{codeblock}
|
7367 | 7365 | @\exposid{reinit-expected}@(@\exposid{val}@, @\exposid{unex}@, *rhs)
|
7368 | 7366 | \end{codeblock}
|
|
7419 | 7417 | If \tcode{this->has_value() \&\& rhs.has_value()} is \tcode{true},
|
7420 | 7418 | equivalent to \tcode{\exposid{val} = std::move(*rhs)}.
|
7421 | 7419 | \item
|
7422 |
| -Otherwise, if \tcode{this->has_value()} is \tcode{true}, equivalent to |
| 7420 | +Otherwise, if \tcode{this->has_value()} is \tcode{true}, equivalent to: |
7423 | 7421 | \begin{codeblock}
|
7424 | 7422 | @\exposid{reinit-expected}@(@\exposid{unex}@, @\exposid{val}@, std::move(rhs.error()))
|
7425 | 7423 | \end{codeblock}
|
7426 | 7424 | \item
|
7427 |
| -Otherwise, if \tcode{rhs.has_value()} is \tcode{true}, equivalent to |
| 7425 | +Otherwise, if \tcode{rhs.has_value()} is \tcode{true}, equivalent to: |
7428 | 7426 | \begin{codeblock}
|
7429 | 7427 | @\exposid{reinit-expected}@(@\exposid{val}@, @\exposid{unex}@, std::move(*rhs))
|
7430 | 7428 | \end{codeblock}
|
|
7456 | 7454 | \item
|
7457 | 7455 | \tcode{is_same_v<expected, remove_cvref_t<U>>} is \tcode{false}; and
|
7458 | 7456 | \item
|
7459 |
| -\tcode{remove_cvref_t<U>} is not a specialization of unexpected; and |
| 7457 | +\tcode{remove_cvref_t<U>} is not a specialization of \tcode{unexpected}; and |
7460 | 7458 | \item
|
7461 | 7459 | \tcode{is_constructible_v<T, U>} is \tcode{true}; and
|
7462 | 7460 | \item
|
|
7474 | 7472 | If \tcode{has_value()} is \tcode{true},
|
7475 | 7473 | equivalent to: \tcode{\exposid{val} = std::forward<U>(v);}
|
7476 | 7474 | \item
|
7477 |
| -Otherwise, equivalent to |
| 7475 | +Otherwise, equivalent to: |
7478 | 7476 | \begin{codeblock}
|
7479 | 7477 | @\exposid{reinit-expected}@(@\exposid{val}@, @\exposid{unex}@, std::forward<U>(v));
|
7480 | 7478 | @\exposid{has_val}@ = true;
|
|
7503 | 7501 | \constraints
|
7504 | 7502 | \begin{itemize}
|
7505 | 7503 | \item
|
7506 |
| -\tcode{is_constructible_v<E, GF>} is \tcode{true}. |
| 7504 | +\tcode{is_constructible_v<E, GF>} is \tcode{true}; and |
7507 | 7505 | \item
|
7508 | 7506 | \tcode{is_assignable_v<E\&, GF>} is \tcode{true}; and
|
7509 | 7507 | \item
|
|
7515 | 7513 | \effects
|
7516 | 7514 | \begin{itemize}
|
7517 | 7515 | \item
|
7518 |
| -If \tcode{has_value()} is \tcode{true}, equivalent to |
| 7516 | +If \tcode{has_value()} is \tcode{true}, equivalent to: |
7519 | 7517 | \begin{codeblock}
|
7520 | 7518 | @\exposid{reinit-expected}@(@\exposid{unex}@, @\exposid{val}@, std::forward<GF>(e.value()));
|
7521 | 7519 | @\exposid{has_val}@ = false;
|
|
7593 | 7591 | \constraints
|
7594 | 7592 | \begin{itemize}
|
7595 | 7593 | \item
|
7596 |
| -\tcode{is_swappable_v<T>;} is \tcode{true} and |
| 7594 | +\tcode{is_swappable_v<T>} is \tcode{true} and |
7597 | 7595 | \item
|
7598 |
| -\tcode{is_swappable_v<E>;} is \tcode{true} and |
| 7596 | +\tcode{is_swappable_v<E>} is \tcode{true} and |
7599 | 7597 | \item
|
7600 | 7598 | \tcode{is_move_constructible_v<T> \&\& is_move_constructible_v<E>}
|
7601 | 7599 | is \tcode{true}, and
|
|
7625 | 7623 | \begin{codeblock}
|
7626 | 7624 | if constexpr (is_nothrow_move_constructible_v<E>) {
|
7627 | 7625 | E tmp(std::move(rhs.@\exposid{unex}@));
|
7628 |
| - destroy_at(addressof(rhs.unex)); |
| 7626 | + destroy_at(addressof(rhs.@\exposid{unex}@)); |
7629 | 7627 | try {
|
7630 | 7628 | construct_at(addressof(rhs.@\exposid{val}@), std::move(@\exposid{val}@));
|
7631 | 7629 | destroy_at(addressof(@\exposid{val}@));
|
|
7638 | 7636 | T tmp(std::move(@\exposid{val}@));
|
7639 | 7637 | destroy_at(addressof(@\exposid{val}@));
|
7640 | 7638 | try {
|
7641 |
| - construct_at(addressof(@\exposid{unex}@), std::move(rhs.unex)); |
| 7639 | + construct_at(addressof(@\exposid{unex}@), std::move(rhs.@\exposid{unex}@)); |
7642 | 7640 | destroy_at(addressof(rhs.@\exposid{unex}@));
|
7643 | 7641 | construct_at(addressof(rhs.@\exposid{val}@), std::move(tmp));
|
7644 | 7642 | } catch (...) {
|
|
7652 | 7650 |
|
7653 | 7651 | \pnum
|
7654 | 7652 | \throws
|
7655 |
| -Any exception thrown by the expressions in the \effects. |
| 7653 | +Any exception thrown by the expressions in the \Fundescx{Effects}. |
7656 | 7654 |
|
7657 | 7655 | \pnum
|
7658 | 7656 | \remarks
|
|
7845 | 7843 | \begin{itemdescr}
|
7846 | 7844 | \pnum
|
7847 | 7845 | \mandates
|
7848 |
| -The expressions \tcode{*x == *y} and \tcode{x.error()== y.error()} |
| 7846 | +The expressions \tcode{*x == *y} and \tcode{x.error() == y.error()} |
7849 | 7847 | are well-formed and their results are convertible to \tcode{bool}.
|
7850 | 7848 |
|
7851 | 7849 | \pnum
|
|
8030 | 8028 |
|
8031 | 8029 | \pnum
|
8032 | 8030 | \ensures
|
8033 |
| -\tcode{rhs.has_value()} is unchanged, |
| 8031 | +\tcode{rhs.has_value()} is unchanged; |
8034 | 8032 | \tcode{rhs.has_value() == this->has_value()} is \tcode{true}.
|
8035 | 8033 |
|
8036 | 8034 | \pnum
|
|
8074 | 8072 | is \tcode{false}; and
|
8075 | 8073 | \item
|
8076 | 8074 | \tcode{is_constructible_v<unexpected<E>, const expected<U, G>>}
|
8077 |
| -is \tcode{false}; and |
| 8075 | +is \tcode{false}. |
8078 | 8076 | \end{itemize}
|
8079 | 8077 |
|
8080 | 8078 | \pnum
|
|
8085 | 8083 |
|
8086 | 8084 | \pnum
|
8087 | 8085 | \ensures
|
8088 |
| -\tcode{rhs.has_value()} is unchanged, |
| 8086 | +\tcode{rhs.has_value()} is unchanged; |
8089 | 8087 | \tcode{rhs.has_value() == this->has_value()} is \tcode{true}.
|
8090 | 8088 |
|
8091 | 8089 | \pnum
|
|
8221 | 8219 | equivalent to: \tcode{construct_at(addressof(\exposid{unex}), rhs.\exposid{unex}); \exposid{has_val} = false;}
|
8222 | 8220 | \item
|
8223 | 8221 | Otherwise, if \tcode{rhs.has_value()} is \tcode{true},
|
8224 |
| -destroys \exposid{unex} and sets \exposid{has_val} to true. |
| 8222 | +destroys \exposid{unex} and sets \exposid{has_val} to \tcode{true}. |
8225 | 8223 | \item
|
8226 | 8224 | Otherwise, equivalent to \tcode{\exposid{unex} = rhs.error()}.
|
8227 | 8225 | \end{itemize}
|
|
8365 | 8363 |
|
8366 | 8364 | \pnum
|
8367 | 8365 | \throws
|
8368 |
| -Any exception thrown by the expressions in the \effects. |
| 8366 | +Any exception thrown by the expressions in the \Fundescx{Effects}. |
8369 | 8367 |
|
8370 | 8368 | \pnum
|
8371 | 8369 | \remarks
|
|
8433 | 8431 | if \tcode{has_value()} is \tcode{false}.
|
8434 | 8432 | \end{itemdescr}
|
8435 | 8433 |
|
| 8434 | +\indexlibrarymember{error}{expected}% |
8436 | 8435 | \begin{itemdecl}
|
8437 | 8436 | constexpr const E& error() const&;
|
8438 | 8437 | constexpr E& error() &;
|
|
0 commit comments