Skip to content

Commit 760ddc3

Browse files
committed
LWG4366 Heterogeneous comparison of expected may be ill-formed
1 parent fe45c50 commit 760ddc3

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

source/utilities.tex

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9408,7 +9408,9 @@
94089408

94099409
\pnum
94109410
\returns
9411-
\tcode{x.has_value() \&\& static_cast<bool>(*x == v)}.
9411+
If \tcode{x.has_value()} is \tcode{true},
9412+
\tcode{*x == v};
9413+
otherwise \tcode{false}.
94129414
\end{itemdescr}
94139415

94149416
\indexlibrarymember{operator==}{expected}%
@@ -9424,7 +9426,9 @@
94249426

94259427
\pnum
94269428
\returns
9427-
\tcode{!x.has_value() \&\& static_cast<bool>(x.error() == e.error())}.
9429+
If \tcode{x.has_value()} is \tcode{true},
9430+
\tcode{x.error() == e.error()};
9431+
otherwise \tcode{false}.
94289432
\end{itemdescr}
94299433

94309434
\rSec2[expected.void]{Partial specialization of \tcode{expected} for \tcode{void} types}
@@ -10346,7 +10350,8 @@
1034610350
\pnum
1034710351
\returns
1034810352
If \tcode{x.has_value()} does not equal \tcode{y.has_value()}, \tcode{false};
10349-
otherwise \tcode{x.has_value() || static_cast<bool>(x.error() == y.error())}.
10353+
otherwise if \tcode{x.has_value()} is \tcode{true}, \tcode{true};
10354+
otherwise \tcode{x.error() == y.error()}.
1035010355
\end{itemdescr}
1035110356

1035210357
\indexlibrarymember{operator==}{expected<void>}%
@@ -10363,7 +10368,9 @@
1036310368

1036410369
\pnum
1036510370
\returns
10366-
\tcode{!x.has_value() \&\& static_cast<bool>(x.error() == e.error())}.
10371+
If \tcode{!x.has_value()} is \tcode{true},
10372+
\tcode{x.error() == e.error()};
10373+
otherwise \tcode{false}.
1036710374
\end{itemdescr}
1036810375

1036910376
\rSec1[bitset]{Bitsets}

0 commit comments

Comments
 (0)