Skip to content

Commit 4c34e8c

Browse files
committed
LWG4304 std::optional<NonReturnable&> is ill-formed due to value_or
1 parent ebd9fc2 commit 4c34e8c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

source/utilities.tex

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4886,6 +4886,10 @@
48864886
\end{itemdecl}
48874887

48884888
\begin{itemdescr}
4889+
\pnum
4890+
\constraints
4891+
\tcode{T} is a non-array object type.
4892+
48894893
\pnum
48904894
Let \tcode{X} be \tcode{remove_cv_t<T>}.
48914895

@@ -4899,6 +4903,14 @@
48994903
\begin{codeblock}
49004904
return has_value() ? *@\exposid{val}@ : static_cast<X>(std::forward<U>(u));
49014905
\end{codeblock}
4906+
4907+
\pnum
4908+
\remarks
4909+
The return type is unspecified if
4910+
\tcode{T} is an array type or a non-object type.
4911+
\begin{note}
4912+
This is to avoid the declaration being ill-formed.
4913+
\end{note}
49024914
\end{itemdescr}
49034915

49044916
\rSec3[optional.ref.monadic]{Monadic operations}

0 commit comments

Comments
 (0)