|
6929 | 6929 | constexpr unexpected& operator=(const unexpected&) = default;
|
6930 | 6930 | constexpr unexpected& operator=(unexpected&&) = default;
|
6931 | 6931 |
|
6932 |
| - constexpr const E& value() const & noexcept; |
6933 |
| - constexpr E& value() & noexcept; |
6934 |
| - constexpr const E&& value() const && noexcept; |
6935 |
| - constexpr E&& value() && noexcept; |
| 6932 | + constexpr const E& error() const & noexcept; |
| 6933 | + constexpr E& error() & noexcept; |
| 6934 | + constexpr const E&& error() const && noexcept; |
| 6935 | + constexpr E&& error() && noexcept; |
6936 | 6936 |
|
6937 | 6937 | constexpr void swap(unexpected& other) noexcept(@\seebelow@);
|
6938 | 6938 |
|
|
6942 | 6942 | friend constexpr void swap(unexpected& x, unexpected& y) noexcept(noexcept(x.swap(y)));
|
6943 | 6943 |
|
6944 | 6944 | private:
|
6945 |
| - E @\exposid{val}@; // \expos |
| 6945 | + E @\exposidnc{unex}@; // \expos |
6946 | 6946 | };
|
6947 | 6947 |
|
6948 | 6948 | template<class E> unexpected(E) -> unexpected<E>;
|
|
6979 | 6979 |
|
6980 | 6980 | \pnum
|
6981 | 6981 | \effects
|
6982 |
| -Direct-non-list-initializes \exposid{val} with \tcode{std::forward<Err>(e)}. |
| 6982 | +Direct-non-list-initializes \exposid{unex} with \tcode{std::forward<Err>(e)}. |
6983 | 6983 |
|
6984 | 6984 | \pnum
|
6985 | 6985 | \throws
|
6986 |
| -Any exception thrown by the initialization of \exposid{val}. |
| 6986 | +Any exception thrown by the initialization of \exposid{unex}. |
6987 | 6987 | \end{itemdescr}
|
6988 | 6988 |
|
6989 | 6989 | \indexlibraryctor{unexpected}%
|
|
7000 | 7000 | \pnum
|
7001 | 7001 | \effects
|
7002 | 7002 | Direct-non-list-initializes
|
7003 |
| -\exposid{val} with \tcode{std::forward<Args>(args)...}. |
| 7003 | +\exposid{unex} with \tcode{std::forward<Args>(args)...}. |
7004 | 7004 |
|
7005 | 7005 | \pnum
|
7006 | 7006 | \throws
|
7007 |
| -Any exception thrown by the initialization of \exposid{val}. |
| 7007 | +Any exception thrown by the initialization of \exposid{unex}. |
7008 | 7008 | \end{itemdescr}
|
7009 | 7009 |
|
7010 | 7010 | \indexlibraryctor{unexpected}%
|
|
7021 | 7021 | \pnum
|
7022 | 7022 | \effects
|
7023 | 7023 | Direct-non-list-initializes
|
7024 |
| -\exposid{val} with \tcode{il, std::forward<Args>(args)...}. |
| 7024 | +\exposid{unex} with \tcode{il, std::forward<Args>(args)...}. |
7025 | 7025 |
|
7026 | 7026 | \pnum
|
7027 | 7027 | \throws
|
7028 |
| -Any exception thrown by the initialization of \exposid{val}. |
| 7028 | +Any exception thrown by the initialization of \exposid{unex}. |
7029 | 7029 | \end{itemdescr}
|
7030 | 7030 |
|
7031 | 7031 | \rSec3[expected.un.obs]{Observers}
|
7032 | 7032 |
|
7033 |
| -\indexlibrarymember{value}{unexpected}% |
| 7033 | +\indexlibrarymember{error}{unexpected}% |
7034 | 7034 | \begin{itemdecl}
|
7035 |
| -constexpr const E& value() const & noexcept; |
7036 |
| -constexpr E& value() & noexcept; |
| 7035 | +constexpr const E& error() const & noexcept; |
| 7036 | +constexpr E& error() & noexcept; |
7037 | 7037 | \end{itemdecl}
|
7038 | 7038 |
|
7039 | 7039 | \begin{itemdescr}
|
7040 | 7040 | \pnum
|
7041 | 7041 | \returns
|
7042 |
| -\exposid{val}. |
| 7042 | +\exposid{unex}. |
7043 | 7043 | \end{itemdescr}
|
7044 | 7044 |
|
7045 |
| -\indexlibrarymember{value}{unexpected}% |
| 7045 | +\indexlibrarymember{error}{unexpected}% |
7046 | 7046 | \begin{itemdecl}
|
7047 |
| -constexpr E&& value() && noexcept; |
7048 |
| -constexpr const E&& value() const && noexcept; |
| 7047 | +constexpr E&& error() && noexcept; |
| 7048 | +constexpr const E&& error() const && noexcept; |
7049 | 7049 | \end{itemdecl}
|
7050 | 7050 |
|
7051 | 7051 | \begin{itemdescr}
|
7052 | 7052 | \pnum
|
7053 | 7053 | \returns
|
7054 |
| -\tcode{std::move(\exposid{val})}. |
| 7054 | +\tcode{std::move(\exposid{unex})}. |
7055 | 7055 | \end{itemdescr}
|
7056 | 7056 |
|
7057 | 7057 | \rSec3[expected.un.swap]{Swap}
|
|
7069 | 7069 | \pnum
|
7070 | 7070 | \effects
|
7071 | 7071 | Equivalent to:
|
7072 |
| -\tcode{using std::swap; swap(\exposid{val}, other.\exposid{val});} |
| 7072 | +\tcode{using std::swap; swap(\exposid{unex}, other.\exposid{unex});} |
7073 | 7073 | \end{itemdescr}
|
7074 | 7074 |
|
7075 | 7075 | \begin{itemdecl}
|
|
7097 | 7097 | \begin{itemdescr}
|
7098 | 7098 | \pnum
|
7099 | 7099 | \mandates
|
7100 |
| -The expression \tcode{x.value() == y.value()} is well-formed and |
| 7100 | +The expression \tcode{x.error() == y.error()} is well-formed and |
7101 | 7101 | its result is convertible to \tcode{bool}.
|
7102 | 7102 |
|
7103 | 7103 | \pnum
|
7104 | 7104 | \returns
|
7105 |
| -\tcode{x.value() == y.value()}. |
| 7105 | +\tcode{x.error() == y.error()}. |
7106 | 7106 | \end{itemdescr}
|
7107 | 7107 |
|
7108 | 7108 | \rSec2[expected.bad]{Class template \tcode{bad_expected_access}}
|
|
7120 | 7120 | E&& error() && noexcept;
|
7121 | 7121 | const E&& error() const && noexcept;
|
7122 | 7122 | private:
|
7123 |
| - E @\exposid{val}@; // \expos |
| 7123 | + E @\exposidnc{unex}@; // \expos |
7124 | 7124 | };
|
7125 | 7125 | }
|
7126 | 7126 | \end{codeblock}
|
|
7139 | 7139 | \begin{itemdescr}
|
7140 | 7140 | \pnum
|
7141 | 7141 | \effects
|
7142 |
| -Initializes \exposid{val} with \tcode{std::move(e)}. |
| 7142 | +Initializes \exposid{unex} with \tcode{std::move(e)}. |
7143 | 7143 | \end{itemdescr}
|
7144 | 7144 |
|
7145 | 7145 | \indexlibrarymember{error}{bad_expected_access}%
|
|
7151 | 7151 | \begin{itemdescr}
|
7152 | 7152 | \pnum
|
7153 | 7153 | \returns
|
7154 |
| -\exposid{val}. |
| 7154 | +\exposid{unex}. |
7155 | 7155 | \end{itemdescr}
|
7156 | 7156 |
|
7157 | 7157 | \indexlibrarymember{error}{bad_expected_access}%
|
|
7163 | 7163 | \begin{itemdescr}
|
7164 | 7164 | \pnum
|
7165 | 7165 | \returns
|
7166 |
| -\tcode{std::move(\exposid{val})}. |
| 7166 | +\tcode{std::move(\exposid{unex})}. |
7167 | 7167 | \end{itemdescr}
|
7168 | 7168 |
|
7169 | 7169 | \indexlibrarymember{what}{bad_expected_access}%
|
|
7575 | 7575 |
|
7576 | 7576 | \pnum
|
7577 | 7577 | \effects
|
7578 |
| -Direct-non-list-initializes \exposid{unex} with \tcode{std::forward<GF>(e.value())}. |
| 7578 | +Direct-non-list-initializes \exposid{unex} with \tcode{std::forward<GF>(e.error())}. |
7579 | 7579 |
|
7580 | 7580 | \pnum
|
7581 | 7581 | \ensures
|
|
7905 | 7905 | \item
|
7906 | 7906 | If \tcode{has_value()} is \tcode{true}, equivalent to:
|
7907 | 7907 | \begin{codeblock}
|
7908 |
| -@\exposid{reinit-expected}@(@\exposid{unex}@, @\exposid{val}@, std::forward<GF>(e.value())); |
| 7908 | +@\exposid{reinit-expected}@(@\exposid{unex}@, @\exposid{val}@, std::forward<GF>(e.error())); |
7909 | 7909 | @\exposid{has_val}@ = false;
|
7910 | 7910 | \end{codeblock}
|
7911 | 7911 | \item
|
7912 | 7912 | Otherwise, equivalent to:
|
7913 |
| -\tcode{\exposid{unex} = std::forward<GF>(e.value());} |
| 7913 | +\tcode{\exposid{unex} = std::forward<GF>(e.error());} |
7914 | 7914 | \end{itemize}
|
7915 | 7915 |
|
7916 | 7916 | \pnum
|
|
8270 | 8270 | \begin{itemdescr}
|
8271 | 8271 | \pnum
|
8272 | 8272 | \mandates
|
8273 |
| -The expression \tcode{x.error() == e.value()} is well-formed and |
| 8273 | +The expression \tcode{x.error() == e.error()} is well-formed and |
8274 | 8274 | its result is convertible to \tcode{bool}.
|
8275 | 8275 |
|
8276 | 8276 | \pnum
|
8277 | 8277 | \returns
|
8278 |
| -\tcode{!x.has_value() \&\& static_cast<bool>(x.error() == e.value())}. |
| 8278 | +\tcode{!x.has_value() \&\& static_cast<bool>(x.error() == e.error())}. |
8279 | 8279 | \end{itemdescr}
|
8280 | 8280 |
|
8281 | 8281 | \rSec2[expected.void]{Partial specialization of \tcode{expected} for \tcode{void} types}
|
|
8516 | 8516 | \pnum
|
8517 | 8517 | \effects
|
8518 | 8518 | Direct-non-list-initializes \exposid{unex}
|
8519 |
| -with \tcode{std::forward<GF>(e.value())}. |
| 8519 | +with \tcode{std::forward<GF>(e.error())}. |
8520 | 8520 |
|
8521 | 8521 | \pnum
|
8522 | 8522 | \ensures
|
|
8703 | 8703 | \item
|
8704 | 8704 | If \tcode{has_value()} is \tcode{true}, equivalent to:
|
8705 | 8705 | \begin{codeblock}
|
8706 |
| -construct_at(addressof(@\exposid{unex}@), std::forward<GF>(e.value())); |
| 8706 | +construct_at(addressof(@\exposid{unex}@), std::forward<GF>(e.error())); |
8707 | 8707 | @\exposid{has_val}@ = false;
|
8708 | 8708 | \end{codeblock}
|
8709 | 8709 | \item
|
8710 | 8710 | Otherwise, equivalent to:
|
8711 |
| -\tcode{\exposid{unex} = std::forward<GF>(e.value());} |
| 8711 | +\tcode{\exposid{unex} = std::forward<GF>(e.error());} |
8712 | 8712 | \end{itemize}
|
8713 | 8713 |
|
8714 | 8714 | \pnum
|
|
8897 | 8897 | \begin{itemdescr}
|
8898 | 8898 | \pnum
|
8899 | 8899 | \mandates
|
8900 |
| -The expression \tcode{x.error() == e.value()} is well-formed and |
| 8900 | +The expression \tcode{x.error() == e.error()} is well-formed and |
8901 | 8901 | its result is convertible to \tcode{bool}.
|
8902 | 8902 |
|
8903 | 8903 | \pnum
|
8904 | 8904 | \returns
|
8905 |
| -\tcode{!x.has_value() \&\& static_cast<bool>(x.error() == e.value())}. |
| 8905 | +\tcode{!x.has_value() \&\& static_cast<bool>(x.error() == e.error())}. |
8906 | 8906 | \end{itemdescr}
|
8907 | 8907 |
|
8908 | 8908 | \rSec1[bitset]{Bitsets}
|
|
0 commit comments