|
6470 | 6470 | \rSec2[expected.general]{In general}
|
6471 | 6471 |
|
6472 | 6472 | \pnum
|
6473 |
| -This subclause describes the class template \tcode{expected} |
| 6473 | +Subclause \ref{expected} describes the class template \tcode{expected} |
6474 | 6474 | that represents expected objects.
|
6475 | 6475 | An \tcode{expected<T, E>} object holds
|
6476 | 6476 | an object of type \tcode{T} or an object of type \tcode{unexpected<E>} and
|
|
6510 | 6510 | \rSec3[expected.un.general]{General}
|
6511 | 6511 |
|
6512 | 6512 | \pnum
|
6513 |
| -This subclause describes the class template \tcode{unexpected} |
| 6513 | +Subclause \ref{expected.unexpected} describes the class template \tcode{unexpected} |
6514 | 6514 | that represents unexpected objects stored in \tcode{expected} objects.
|
6515 | 6515 |
|
6516 | 6516 | \rSec3[expected.un.object]{Class template \tcode{unexpected}}
|
|
6874 | 6874 |
|
6875 | 6875 | // \ref{expected.object.swap}, swap
|
6876 | 6876 | 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))); |
6878 | 6878 |
|
6879 | 6879 | // \ref{expected.object.obs}, observers
|
6880 | 6880 | constexpr const T* operator->() const noexcept;
|
|
6897 | 6897 | template<class U> constexpr T value_or(U&&) &&;
|
6898 | 6898 |
|
6899 | 6899 | // \ref{expected.object.eq}, equality operators
|
6900 |
| - template<class T2, class E2> |
| 6900 | + template<class T2, class E2> requires (!is_void_v<T2>) |
6901 | 6901 | friend constexpr bool operator==(const expected& x, const expected<T2, E2>& y);
|
6902 | 6902 | template<class T2>
|
6903 | 6903 | friend constexpr bool operator==(const expected&, const T2&);
|
|
7044 | 7044 |
|
7045 | 7045 | \pnum
|
7046 | 7046 | \remarks
|
7047 |
| -The exception specification is |
| 7047 | +The exception specification is equivalent to |
7048 | 7048 | \tcode{is_nothrow_move_constructible_v<T> \&\&
|
7049 | 7049 | is_nothrow_move_constructible_v<E>}.
|
7050 | 7050 |
|
|
7383 | 7383 | \item
|
7384 | 7384 | \tcode{is_copy_constructible_v<E>} is \tcode{true} and
|
7385 | 7385 | \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>} |
7387 | 7387 | is \tcode{true}.
|
7388 | 7388 | \end{itemize}
|
7389 | 7389 | \end{itemdescr}
|
|
7434 | 7434 |
|
7435 | 7435 | \pnum
|
7436 | 7436 | \remarks
|
7437 |
| -The exception specification is |
| 7437 | +The exception specification is equivalent to: |
7438 | 7438 | \begin{codeblock}
|
7439 | 7439 | is_nothrow_move_assignable_v<T> && is_nothrow_move_constructible_v<T> &&
|
7440 | 7440 | is_nothrow_move_assignable_v<E> && is_nothrow_move_constructible_v<E>
|
|
7609 | 7609 | \begin{floattable}{\tcode{swap(expected\&)} effects}{expected.object.swap}
|
7610 | 7610 | {lx{0.35\hsize}x{0.35\hsize}}
|
7611 | 7611 | \topline
|
7612 |
| -& \chdr{\tcode{this->has_value()}} & \rhdr{\tcode{!has_value()}} \\ \capsep |
| 7612 | +& \chdr{\tcode{this->has_value()}} & \rhdr{\tcode{!this->has_value()}} \\ \capsep |
7613 | 7613 | \lhdr{\tcode{rhs.has_value()}} &
|
7614 | 7614 | equivalent to: \tcode{using std::swap; swap(\exposid{val}, rhs.\exposid{val});} &
|
7615 | 7615 | calls \tcode{rhs.swap(*this)} \\
|
|
7654 | 7654 |
|
7655 | 7655 | \pnum
|
7656 | 7656 | \remarks
|
7657 |
| -The exception specification is: |
| 7657 | +The exception specification is equivalent to: |
7658 | 7658 | \begin{codeblock}
|
7659 | 7659 | is_nothrow_move_constructible_v<T> && is_nothrow_swappable_v<T> &&
|
7660 | 7660 | is_nothrow_move_constructible_v<E> && is_nothrow_swappable_v<E>
|
|
7809 | 7809 | \pnum
|
7810 | 7810 | \mandates
|
7811 | 7811 | \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}. |
7813 | 7813 |
|
7814 | 7814 | \pnum
|
7815 | 7815 | \returns
|
|
7825 | 7825 | \pnum
|
7826 | 7826 | \mandates
|
7827 | 7827 | \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}. |
7829 | 7829 |
|
7830 | 7830 | \pnum
|
7831 | 7831 | \returns
|
|
7855 | 7855 |
|
7856 | 7856 | \indexlibrarymember{operator==}{expected}%
|
7857 | 7857 | \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); |
7859 | 7859 | \end{itemdecl}
|
7860 | 7860 |
|
7861 | 7861 | \begin{itemdescr}
|
|
7874 | 7874 |
|
7875 | 7875 | \indexlibrarymember{operator==}{expected}%
|
7876 | 7876 | \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); |
7878 | 7878 | \end{itemdecl}
|
7879 | 7879 |
|
7880 | 7880 | \begin{itemdescr}
|
|
7938 | 7938 |
|
7939 | 7939 | // \ref{expected.void.swap}, swap
|
7940 | 7940 | 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))); |
7942 | 7942 |
|
7943 | 7943 | // \ref{expected.void.obs}, observers
|
7944 | 7944 | constexpr explicit operator bool() const noexcept;
|
|
8265 | 8265 |
|
8266 | 8266 | \pnum
|
8267 | 8267 | \remarks
|
8268 |
| -The exception specification is |
| 8268 | +The exception specification is equivalent to |
8269 | 8269 | \tcode{is_nothrow_move_constructible_v<E> \&\& is_nothrow_move_assignable_v<E>}.
|
8270 | 8270 |
|
8271 | 8271 | \pnum
|
|
8343 | 8343 | \begin{floattable}{\tcode{swap(expected\&)} effects}{expected.void.swap}
|
8344 | 8344 | {lx{0.35\hsize}x{0.35\hsize}}
|
8345 | 8345 | \topline
|
8346 |
| -& \chdr{\tcode{this->has_value()}} & \rhdr{\tcode{!has_value()}} \\ \capsep |
| 8346 | +& \chdr{\tcode{this->has_value()}} & \rhdr{\tcode{!this->has_value()}} \\ \capsep |
8347 | 8347 | \lhdr{\tcode{rhs.has_value()}} &
|
8348 | 8348 | no effects &
|
8349 | 8349 | calls \tcode{rhs.swap(*this)} \\
|
|
8367 | 8367 |
|
8368 | 8368 | \pnum
|
8369 | 8369 | \remarks
|
8370 |
| -The exception specification is |
| 8370 | +The exception specification is equivalent to |
8371 | 8371 | \tcode{is_nothrow_move_constructible_v<E> \&\& is_nothrow_swappable_v<E>}.
|
8372 | 8372 | \end{itemdescr}
|
8373 | 8373 |
|
|
0 commit comments