Skip to content

Commit 9041b27

Browse files
committed
[optional.monaic] Restore wording effected by LWG3973.
Both LWG3973 (Motion 1) and P2407R5 (Motion 3) modified this wording: LWG3973 changes "value()" to "*val" to address ADL concerns, and P2407R5 changed "value()" to "**this" to be freestanding. In light of the former, the latter should also use "*val". Independently, additional problems have been discovered with LWG3973, but those will be addressed by a future LWG issue.
1 parent 7f97465 commit 9041b27

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

source/utilities.tex

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4172,7 +4172,7 @@
41724172
Equivalent to:
41734173
\begin{codeblock}
41744174
if (*this) {
4175-
return invoke(std::forward<F>(f), **this);
4175+
return invoke(std::forward<F>(f), *val);
41764176
} else {
41774177
return remove_cvref_t<U>();
41784178
}
@@ -4187,7 +4187,7 @@
41874187

41884188
\begin{itemdescr}
41894189
\pnum
4190-
Let \tcode{U} be \tcode{invoke_result_t<F, decltype(std::move(**this))>}.
4190+
Let \tcode{U} be \tcode{invoke_result_t<F, decltype(std::move(*val))>}.
41914191

41924192
\pnum
41934193
\mandates
@@ -4198,7 +4198,7 @@
41984198
Equivalent to:
41994199
\begin{codeblock}
42004200
if (*this) {
4201-
return invoke(std::forward<F>(f), std::move(**this));
4201+
return invoke(std::forward<F>(f), std::move(*val));
42024202
} else {
42034203
return remove_cvref_t<U>();
42044204
}
@@ -4213,15 +4213,15 @@
42134213

42144214
\begin{itemdescr}
42154215
\pnum
4216-
Let \tcode{U} be \tcode{remove_cv_t<invoke_result_t<F, decltype(**this)>>}.
4216+
Let \tcode{U} be \tcode{remove_cv_t<invoke_result_t<F, decltype(*val)>>}.
42174217

42184218
\pnum
42194219
\mandates
42204220
\tcode{U} is a non-array object type
42214221
other than \tcode{in_place_t} or \tcode{nullopt_t}.
42224222
The declaration
42234223
\begin{codeblock}
4224-
U u(invoke(std::forward<F>(f), **this));
4224+
U u(invoke(std::forward<F>(f), *val));
42254225
\end{codeblock}
42264226
is well-formed for some invented variable \tcode{u}.
42274227
\begin{note}
@@ -4232,7 +4232,7 @@
42324232
\returns
42334233
If \tcode{*this} contains a value, an \tcode{optional<U>} object
42344234
whose contained value is direct-non-list-initialized with
4235-
\tcode{invoke(std::forward<F>(f), **this)};
4235+
\tcode{invoke(std::forward<F>(f), *val)};
42364236
otherwise, \tcode{optional<U>()}.
42374237
\end{itemdescr}
42384238

@@ -4245,15 +4245,15 @@
42454245
\begin{itemdescr}
42464246
\pnum
42474247
Let \tcode{U} be
4248-
\tcode{remove_cv_t<invoke_result_t<F, decltype(std::move(**this))>>}.
4248+
\tcode{remove_cv_t<invoke_result_t<F, decltype(std::move(*val))>>}.
42494249

42504250
\pnum
42514251
\mandates
42524252
\tcode{U} is a non-array object type
42534253
other than \tcode{in_place_t} or \tcode{nullopt_t}.
42544254
The declaration
42554255
\begin{codeblock}
4256-
U u(invoke(std::forward<F>(f), std::move(**this)));
4256+
U u(invoke(std::forward<F>(f), std::move(*val)));
42574257
\end{codeblock}
42584258
is well-formed for some invented variable \tcode{u}.
42594259
\begin{note}
@@ -4264,7 +4264,7 @@
42644264
\returns
42654265
If \tcode{*this} contains a value, an \tcode{optional<U>} object
42664266
whose contained value is direct-non-list-initialized with
4267-
\tcode{invoke(std::forward<F>(f), std::move(**this))};
4267+
\tcode{invoke(std::forward<F>(f), std::move(*val))};
42684268
otherwise, \tcode{optional<U>()}.
42694269
\end{itemdescr}
42704270

0 commit comments

Comments
 (0)