Skip to content

Commit 26183aa

Browse files
burblebeetkoeppe
authored andcommitted
LWG3843 std::expected<T,E>::value() & assumes E is copy constructible
1 parent 093eb5e commit 26183aa

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

source/utilities.tex

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8169,13 +8169,17 @@
81698169
\end{itemdecl}
81708170

81718171
\begin{itemdescr}
8172+
\pnum
8173+
\mandates
8174+
\tcode{is_copy_constructible_v<E>} is \tcode{true}.
8175+
81728176
\pnum
81738177
\returns
81748178
\exposid{val}, if \tcode{has_value()} is \tcode{true}.
81758179

81768180
\pnum
81778181
\throws
8178-
\tcode{bad_expected_access(error())} if \tcode{has_value()} is \tcode{false}.
8182+
\tcode{bad_expected_access(as_const(error()))} if \tcode{has_value()} is \tcode{false}.
81798183
\end{itemdescr}
81808184

81818185
\indexlibrarymember{value}{expected}%
@@ -8185,6 +8189,11 @@
81858189
\end{itemdecl}
81868190

81878191
\begin{itemdescr}
8192+
\pnum
8193+
\mandates
8194+
\tcode{is_copy_constructible_v<E>} is \tcode{true} and
8195+
\tcode{is_constructible_v<E, decltype(std::\linebreak{}move(error()))>} is \tcode{true}.
8196+
81888197
\pnum
81898198
\returns
81908199
\tcode{std::move(\exposid{val})}, if \tcode{has_value()} is \tcode{true}.

0 commit comments

Comments
 (0)