Skip to content

Commit 265b477

Browse files
eisenwavetkoeppe
authored andcommitted
LWG4366 Heterogeneous comparison of expected may be ill-formed
1 parent ab723fb commit 265b477

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
@@ -9410,7 +9410,9 @@
94109410

94119411
\pnum
94129412
\returns
9413-
\tcode{x.has_value() \&\& static_cast<bool>(*x == v)}.
9413+
If \tcode{x.has_value()} is \tcode{true},
9414+
\tcode{*x == v};
9415+
otherwise \tcode{false}.
94149416
\end{itemdescr}
94159417

94169418
\indexlibrarymember{operator==}{expected}%
@@ -9426,7 +9428,9 @@
94269428

94279429
\pnum
94289430
\returns
9429-
\tcode{!x.has_value() \&\& static_cast<bool>(x.error() == e.error())}.
9431+
If \tcode{x.has_value()} is \tcode{true},
9432+
\tcode{x.error() == e.error()};
9433+
otherwise \tcode{false}.
94309434
\end{itemdescr}
94319435

94329436
\rSec2[expected.void]{Partial specialization of \tcode{expected} for \tcode{void} types}
@@ -10348,7 +10352,8 @@
1034810352
\pnum
1034910353
\returns
1035010354
If \tcode{x.has_value()} does not equal \tcode{y.has_value()}, \tcode{false};
10351-
otherwise \tcode{x.has_value() || static_cast<bool>(x.error() == y.error())}.
10355+
otherwise if \tcode{x.has_value()} is \tcode{true}, \tcode{true};
10356+
otherwise \tcode{x.error() == y.error()}.
1035210357
\end{itemdescr}
1035310358

1035410359
\indexlibrarymember{operator==}{expected<void>}%
@@ -10365,7 +10370,9 @@
1036510370

1036610371
\pnum
1036710372
\returns
10368-
\tcode{!x.has_value() \&\& static_cast<bool>(x.error() == e.error())}.
10373+
If \tcode{!x.has_value()} is \tcode{true},
10374+
\tcode{x.error() == e.error()};
10375+
otherwise \tcode{false}.
1036910376
\end{itemdescr}
1037010377

1037110378
\rSec1[bitset]{Bitsets}

0 commit comments

Comments
 (0)