Skip to content

Commit 81b9370

Browse files
committed
[expected] Miscellaneous fixes
This fixes issues introduced with P0323R12 std::expected.
1 parent b06e7ab commit 81b9370

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

source/utilities.tex

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6470,7 +6470,7 @@
64706470
\rSec2[expected.general]{In general}
64716471

64726472
\pnum
6473-
This subclause describes the class template \tcode{expected}
6473+
Subclause \ref{expected} describes the class template \tcode{expected}
64746474
that represents expected objects.
64756475
An \tcode{expected<T, E>} object holds
64766476
an object of type \tcode{T} or an object of type \tcode{unexpected<E>} and
@@ -6510,7 +6510,7 @@
65106510
\rSec3[expected.un.general]{General}
65116511

65126512
\pnum
6513-
This subclause describes the class template \tcode{unexpected}
6513+
Subclause \ref{expected.unexpected} describes the class template \tcode{unexpected}
65146514
that represents unexpected objects stored in \tcode{expected} objects.
65156515

65166516
\rSec3[expected.un.object]{Class template \tcode{unexpected}}
@@ -6874,7 +6874,7 @@
68746874

68756875
// \ref{expected.object.swap}, swap
68766876
constexpr void swap(expected&) noexcept(@\seebelow@);
6877-
friend constexpr void swap(expected&, expected&) noexcept(@\seebelow@);
6877+
friend constexpr void swap(expected& x, expected& y) noexcept(noexcept(x.swap(y)));
68786878

68796879
// \ref{expected.object.obs}, observers
68806880
constexpr const T* operator->() const noexcept;
@@ -6897,7 +6897,7 @@
68976897
template<class U> constexpr T value_or(U&&) &&;
68986898

68996899
// \ref{expected.object.eq}, equality operators
6900-
template<class T2, class E2>
6900+
template<class T2, class E2> requires (!is_void_v<T2>)
69016901
friend constexpr bool operator==(const expected& x, const expected<T2, E2>& y);
69026902
template<class T2>
69036903
friend constexpr bool operator==(const expected&, const T2&);
@@ -7044,7 +7044,7 @@
70447044

70457045
\pnum
70467046
\remarks
7047-
The exception specification is
7047+
The exception specification is equivalent to
70487048
\tcode{is_nothrow_move_constructible_v<T> \&\&
70497049
is_nothrow_move_constructible_v<E>}.
70507050

@@ -7383,7 +7383,7 @@
73837383
\item
73847384
\tcode{is_copy_constructible_v<E>} is \tcode{true} and
73857385
\item
7386-
\tcode{is_nothrow_move_constructible_v<E> || is_nothrow_move_constructible_v<T>}
7386+
\tcode{is_nothrow_move_constructible_v<T> || is_nothrow_move_constructible_v<E>}
73877387
is \tcode{true}.
73887388
\end{itemize}
73897389
\end{itemdescr}
@@ -7434,7 +7434,7 @@
74347434

74357435
\pnum
74367436
\remarks
7437-
The exception specification is
7437+
The exception specification is equivalent to:
74387438
\begin{codeblock}
74397439
is_nothrow_move_assignable_v<T> && is_nothrow_move_constructible_v<T> &&
74407440
is_nothrow_move_assignable_v<E> && is_nothrow_move_constructible_v<E>
@@ -7609,7 +7609,7 @@
76097609
\begin{floattable}{\tcode{swap(expected\&)} effects}{expected.object.swap}
76107610
{lx{0.35\hsize}x{0.35\hsize}}
76117611
\topline
7612-
& \chdr{\tcode{this->has_value()}} & \rhdr{\tcode{!has_value()}} \\ \capsep
7612+
& \chdr{\tcode{this->has_value()}} & \rhdr{\tcode{!this->has_value()}} \\ \capsep
76137613
\lhdr{\tcode{rhs.has_value()}} &
76147614
equivalent to: \tcode{using std::swap; swap(\exposid{val}, rhs.\exposid{val});} &
76157615
calls \tcode{rhs.swap(*this)} \\
@@ -7654,7 +7654,7 @@
76547654

76557655
\pnum
76567656
\remarks
7657-
The exception specification is:
7657+
The exception specification is equivalent to:
76587658
\begin{codeblock}
76597659
is_nothrow_move_constructible_v<T> && is_nothrow_swappable_v<T> &&
76607660
is_nothrow_move_constructible_v<E> && is_nothrow_swappable_v<E>
@@ -7809,7 +7809,7 @@
78097809
\pnum
78107810
\mandates
78117811
\tcode{is_copy_constructible_v<T>} is \tcode{true} and
7812-
\tcode{is_convertible<U, T>} is \tcode{true}.
7812+
\tcode{is_convertible_v<U, T>} is \tcode{true}.
78137813

78147814
\pnum
78157815
\returns
@@ -7825,7 +7825,7 @@
78257825
\pnum
78267826
\mandates
78277827
\tcode{is_move_constructible_v<T>} is \tcode{true} and
7828-
\tcode{is_convertible<U, T>} is \tcode{true}.
7828+
\tcode{is_convertible_v<U, T>} is \tcode{true}.
78297829

78307830
\pnum
78317831
\returns
@@ -7855,7 +7855,7 @@
78557855

78567856
\indexlibrarymember{operator==}{expected}%
78577857
\begin{itemdecl}
7858-
template<class T2> constexpr bool operator==(const expected& x, const T2& v);
7858+
template<class T2> friend constexpr bool operator==(const expected& x, const T2& v);
78597859
\end{itemdecl}
78607860

78617861
\begin{itemdescr}
@@ -7874,7 +7874,7 @@
78747874

78757875
\indexlibrarymember{operator==}{expected}%
78767876
\begin{itemdecl}
7877-
template<class E2> constexpr bool operator==(const expected& x, const unexpected<E2>& e);
7877+
template<class E2> friend constexpr bool operator==(const expected& x, const unexpected<E2>& e);
78787878
\end{itemdecl}
78797879

78807880
\begin{itemdescr}
@@ -7938,7 +7938,7 @@
79387938

79397939
// \ref{expected.void.swap}, swap
79407940
constexpr void swap(expected&) noexcept(@\seebelow@);
7941-
friend constexpr void swap(expected&, expected&) noexcept(@\seebelow@);
7941+
friend constexpr void swap(expected& x, expected& y) noexcept(noexcept(x.swap(y)));
79427942

79437943
// \ref{expected.void.obs}, observers
79447944
constexpr explicit operator bool() const noexcept;
@@ -8265,7 +8265,7 @@
82658265

82668266
\pnum
82678267
\remarks
8268-
The exception specification is
8268+
The exception specification is equivalent to
82698269
\tcode{is_nothrow_move_constructible_v<E> \&\& is_nothrow_move_assignable_v<E>}.
82708270

82718271
\pnum
@@ -8343,7 +8343,7 @@
83438343
\begin{floattable}{\tcode{swap(expected\&)} effects}{expected.void.swap}
83448344
{lx{0.35\hsize}x{0.35\hsize}}
83458345
\topline
8346-
& \chdr{\tcode{this->has_value()}} & \rhdr{\tcode{!has_value()}} \\ \capsep
8346+
& \chdr{\tcode{this->has_value()}} & \rhdr{\tcode{!this->has_value()}} \\ \capsep
83478347
\lhdr{\tcode{rhs.has_value()}} &
83488348
no effects &
83498349
calls \tcode{rhs.swap(*this)} \\
@@ -8367,7 +8367,7 @@
83678367

83688368
\pnum
83698369
\remarks
8370-
The exception specification is
8370+
The exception specification is equivalent to
83718371
\tcode{is_nothrow_move_constructible_v<E> \&\& is_nothrow_swappable_v<E>}.
83728372
\end{itemdescr}
83738373

0 commit comments

Comments
 (0)