Skip to content

Commit 093eb5e

Browse files
burblebeetkoeppe
authored andcommitted
LWG3836 std::expected<bool, E1> conversion constructor expected(const expected<U, G>&) should take precedence over expected(U&&) with operator bool
1 parent 052eab4 commit 093eb5e

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

source/utilities.tex

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3473,9 +3473,13 @@
34733473
\begin{itemdescr}
34743474
\pnum
34753475
\constraints
3476-
\tcode{is_constructible_v<T, U>} is \tcode{true},
3477-
\tcode{is_same_v<remove_cvref_t<U>, in_place_t>} is \tcode{false}, and
3478-
\tcode{is_same_v<remove_cvref_t<U>, optional>} is \tcode{false}.
3476+
\begin{itemize}
3477+
\item \tcode{is_constructible_v<T, U>} is \tcode{true},
3478+
\item \tcode{is_same_v<remove_cvref_t<U>, in_place_t>} is \tcode{false},
3479+
\item \tcode{is_same_v<remove_cvref_t<U>, optional>} is \tcode{false}, and
3480+
\item if \tcode{T} is \cv{} \tcode{bool},
3481+
\tcode{remove_cvref_t<U>} is not a specialization of \tcode{optional}.
3482+
\end{itemize}
34793483

34803484
\pnum
34813485
\effects
@@ -3509,7 +3513,8 @@
35093513
\constraints
35103514
\begin{itemize}
35113515
\item \tcode{is_constructible_v<T, const U\&>} is \tcode{true}, and
3512-
\item \tcode{\exposid{converts-from-any-cvref}<T, optional<U>>} is \tcode{false}.
3516+
\item if \tcode{T} is not \cv{} \tcode{bool},
3517+
\tcode{\exposid{converts-from-any-cvref}<T, optional<U>>} is \tcode{false}.
35133518
\end{itemize}
35143519

35153520
\pnum
@@ -3543,7 +3548,8 @@
35433548
\constraints
35443549
\begin{itemize}
35453550
\item \tcode{is_constructible_v<T, U>} is \tcode{true}, and
3546-
\item \tcode{\exposid{converts-from-any-cvref}<T, optional<U>>} is \tcode{false}.
3551+
\item if \tcode{T} is not \cv{} \tcode{bool},
3552+
\tcode{\exposid{converts-from-any-cvref}<T, optional<U>>} is \tcode{false}.
35473553
\end{itemize}
35483554

35493555
\pnum
@@ -7509,6 +7515,7 @@
75097515
\item
75107516
\tcode{is_constructible_v<E, GF>} is \tcode{true}; and
75117517
\item
7518+
if \tcode{T} is not \cv{} \tcode{bool},
75127519
\tcode{\exposid{converts-from-any-cvref}<T, expected<U, G>>} is \tcode{false}; and
75137520
\item
75147521
\tcode{is_constructible_v<unexpected<E>, expected<U, G>\&>} is \tcode{false}; and
@@ -7559,7 +7566,10 @@
75597566
\item
75607567
\tcode{remove_cvref_t<U>} is not a specialization of \tcode{unexpected}; and
75617568
\item
7562-
\tcode{is_constructible_v<T, U>} is \tcode{true}.
7569+
\tcode{is_constructible_v<T, U>} is \tcode{true}; and
7570+
\item
7571+
if \tcode{T} is \cv{} \tcode{bool},
7572+
\tcode{remove_cvref_t<U>} is not a specialization of \tcode{expected}.
75637573
\end{itemize}
75647574

75657575
\pnum

0 commit comments

Comments
 (0)