|
1282 | 1282 |
|
1283 | 1283 | \begin{itemdescr}
|
1284 | 1284 | \pnum
|
1285 |
| -\expects |
1286 |
| -Each of \tcode{decltype(x.first == y.first)} and |
1287 |
| -\tcode{decltype(x.second == y.second)} models \exposconcept{boolean-testable}. |
| 1285 | +\constraints |
| 1286 | +\tcode{x.first == y.first} and \tcode{x.second == y.second} are |
| 1287 | +valid expressions and |
| 1288 | +each of \tcode{decltype(x.first == y.first)} and |
| 1289 | +\tcode{decltype(x.second == y.second)} models \exposconceptx{boolean-\newline testable}{boolean-testable}. |
1288 | 1290 |
|
1289 | 1291 | \pnum
|
1290 | 1292 | \returns
|
|
2935 | 2937 | For the first overload let \tcode{UTuple} be \tcode{tuple<UTypes...>}.
|
2936 | 2938 |
|
2937 | 2939 | \pnum
|
2938 |
| -\mandates |
| 2940 | +\constraints |
2939 | 2941 | For all \tcode{i},
|
2940 | 2942 | where $0 \leq \tcode{i} < \tcode{sizeof...(TTypes)}$,
|
2941 |
| -\tcode{get<i>(t) == get<i>(u)} is a valid expression. |
| 2943 | +\tcode{get<i>(t) == get<i>(u)} is a valid expression and |
| 2944 | +\tcode{decltype(get<i>(t) == get<i>(u))} models \exposconcept{boolean-testable}. |
2942 | 2945 | \tcode{sizeof...(TTypes)} equals
|
2943 | 2946 | \tcode{tuple_size_v<UTuple>}.
|
2944 | 2947 |
|
2945 |
| -\pnum |
2946 |
| -\expects |
2947 |
| -For all \tcode{i}, \tcode{decltype(get<i>(t) == get<i>(u))} models |
2948 |
| -\exposconcept{boolean-testable}. |
2949 |
| - |
2950 | 2948 | \pnum
|
2951 | 2949 | \returns
|
2952 | 2950 | \tcode{true} if \tcode{get<i>(t) == get<i>(u)} for all
|
|
4399 | 4397 |
|
4400 | 4398 | \begin{itemdescr}
|
4401 | 4399 | \pnum
|
4402 |
| -\mandates |
| 4400 | +\constraints |
4403 | 4401 | The expression \tcode{*x == *y} is well-formed and
|
4404 | 4402 | its result is convertible to \tcode{bool}.
|
4405 | 4403 | \begin{note}
|
|
4424 | 4422 |
|
4425 | 4423 | \begin{itemdescr}
|
4426 | 4424 | \pnum
|
4427 |
| -\mandates |
| 4425 | +\constraints |
4428 | 4426 | The expression \tcode{*x != *y} is well-formed and
|
4429 | 4427 | its result is convertible to \tcode{bool}.
|
4430 | 4428 |
|
|
4448 | 4446 |
|
4449 | 4447 | \begin{itemdescr}
|
4450 | 4448 | \pnum
|
4451 |
| -\mandates |
| 4449 | +\constraints |
4452 | 4450 | \tcode{*x < *y} is well-formed
|
4453 | 4451 | and its result is convertible to \tcode{bool}.
|
4454 | 4452 |
|
|
4472 | 4470 |
|
4473 | 4471 | \begin{itemdescr}
|
4474 | 4472 | \pnum
|
4475 |
| -\mandates |
| 4473 | +\constraints |
4476 | 4474 | The expression \tcode{*x > *y} is well-formed and
|
4477 | 4475 | its result is convertible to \tcode{bool}.
|
4478 | 4476 |
|
|
4496 | 4494 |
|
4497 | 4495 | \begin{itemdescr}
|
4498 | 4496 | \pnum
|
4499 |
| -\mandates |
| 4497 | +\constraints |
4500 | 4498 | The expression \tcode{*x <= *y} is well-formed and
|
4501 | 4499 | its result is convertible to \tcode{bool}.
|
4502 | 4500 |
|
|
4520 | 4518 |
|
4521 | 4519 | \begin{itemdescr}
|
4522 | 4520 | \pnum
|
4523 |
| -\mandates |
| 4521 | +\constraints |
4524 | 4522 | The expression \tcode{*x >= *y} is well-formed and
|
4525 | 4523 | its result is convertible to \tcode{bool}.
|
4526 | 4524 |
|
|
4589 | 4587 |
|
4590 | 4588 | \begin{itemdescr}
|
4591 | 4589 | \pnum
|
4592 |
| -\mandates |
| 4590 | +\constraints |
4593 | 4591 | The expression \tcode{*x == v} is well-formed and
|
4594 | 4592 | its result is convertible to \tcode{bool}.
|
4595 | 4593 | \begin{note}
|
|
4608 | 4606 |
|
4609 | 4607 | \begin{itemdescr}
|
4610 | 4608 | \pnum
|
4611 |
| -\mandates |
| 4609 | +\constraints |
4612 | 4610 | The expression \tcode{v == *x} is well-formed and
|
4613 | 4611 | its result is convertible to \tcode{bool}.
|
4614 | 4612 |
|
|
4624 | 4622 |
|
4625 | 4623 | \begin{itemdescr}
|
4626 | 4624 | \pnum
|
4627 |
| -\mandates |
| 4625 | +\constraints |
4628 | 4626 | The expression \tcode{*x != v} is well-formed and
|
4629 | 4627 | its result is convertible to \tcode{bool}.
|
4630 | 4628 |
|
|
4640 | 4638 |
|
4641 | 4639 | \begin{itemdescr}
|
4642 | 4640 | \pnum
|
4643 |
| -\mandates |
| 4641 | +\constraints |
4644 | 4642 | The expression \tcode{v != *x} is well-formed and
|
4645 | 4643 | its result is convertible to \tcode{bool}.
|
4646 | 4644 |
|
|
4656 | 4654 |
|
4657 | 4655 | \begin{itemdescr}
|
4658 | 4656 | \pnum
|
4659 |
| -\mandates |
| 4657 | +\constraints |
4660 | 4658 | The expression \tcode{*x < v} is well-formed and
|
4661 | 4659 | its result is convertible to \tcode{bool}.
|
4662 | 4660 |
|
|
4672 | 4670 |
|
4673 | 4671 | \begin{itemdescr}
|
4674 | 4672 | \pnum
|
4675 |
| -\mandates |
| 4673 | +\constraints |
4676 | 4674 | The expression \tcode{v < *x} is well-formed and
|
4677 | 4675 | its result is convertible to \tcode{bool}.
|
4678 | 4676 |
|
|
4688 | 4686 |
|
4689 | 4687 | \begin{itemdescr}
|
4690 | 4688 | \pnum
|
4691 |
| -\mandates |
| 4689 | +\constraints |
4692 | 4690 | The expression \tcode{*x > v} is well-formed and
|
4693 | 4691 | its result is convertible to \tcode{bool}.
|
4694 | 4692 |
|
|
4704 | 4702 |
|
4705 | 4703 | \begin{itemdescr}
|
4706 | 4704 | \pnum
|
4707 |
| -\mandates |
| 4705 | +\constraints |
4708 | 4706 | The expression \tcode{v > *x} is well-formed and
|
4709 | 4707 | its result is convertible to \tcode{bool}.
|
4710 | 4708 |
|
|
4720 | 4718 |
|
4721 | 4719 | \begin{itemdescr}
|
4722 | 4720 | \pnum
|
4723 |
| -\mandates |
| 4721 | +\constraints |
4724 | 4722 | The expression \tcode{*x <= v} is well-formed and
|
4725 | 4723 | its result is convertible to \tcode{bool}.
|
4726 | 4724 |
|
|
4736 | 4734 |
|
4737 | 4735 | \begin{itemdescr}
|
4738 | 4736 | \pnum
|
4739 |
| -\mandates |
| 4737 | +\constraints |
4740 | 4738 | The expression \tcode{v <= *x} is well-formed and
|
4741 | 4739 | its result is convertible to \tcode{bool}.
|
4742 | 4740 |
|
|
4752 | 4750 |
|
4753 | 4751 | \begin{itemdescr}
|
4754 | 4752 | \pnum
|
4755 |
| -\mandates |
| 4753 | +\constraints |
4756 | 4754 | The expression \tcode{*x >= v} is well-formed and
|
4757 | 4755 | its result is convertible to \tcode{bool}.
|
4758 | 4756 |
|
|
4768 | 4766 |
|
4769 | 4767 | \begin{itemdescr}
|
4770 | 4768 | \pnum
|
4771 |
| -\mandates |
| 4769 | +\constraints |
4772 | 4770 | The expression \tcode{v >= *x} is well-formed and
|
4773 | 4771 | its result is convertible to \tcode{bool}.
|
4774 | 4772 |
|
|
5991 | 5989 |
|
5992 | 5990 | \begin{itemdescr}
|
5993 | 5991 | \pnum
|
5994 |
| -\mandates |
| 5992 | +\constraints |
5995 | 5993 | \tcode{\exposid{GET}<$i$>(v) == \exposid{GET}<$i$>(w)} is a valid expression that is
|
5996 | 5994 | convertible to \tcode{bool}, for all $i$.
|
5997 | 5995 |
|
|
6010 | 6008 |
|
6011 | 6009 | \begin{itemdescr}
|
6012 | 6010 | \pnum
|
6013 |
| -\mandates |
| 6011 | +\constraints |
6014 | 6012 | \tcode{\exposid{GET}<$i$>(v) != \exposid{GET}<$i$>(w)} is a valid expression that is
|
6015 | 6013 | convertible to \tcode{bool}, for all $i$.
|
6016 | 6014 |
|
|
6029 | 6027 |
|
6030 | 6028 | \begin{itemdescr}
|
6031 | 6029 | \pnum
|
6032 |
| -\mandates |
| 6030 | +\constraints |
6033 | 6031 | \tcode{\exposid{GET}<$i$>(v) < \exposid{GET}<$i$>(w)} is a valid expression that is
|
6034 | 6032 | convertible to \tcode{bool}, for all $i$.
|
6035 | 6033 |
|
|
6050 | 6048 |
|
6051 | 6049 | \begin{itemdescr}
|
6052 | 6050 | \pnum
|
6053 |
| -\mandates |
| 6051 | +\constraints |
6054 | 6052 | \tcode{\exposid{GET}<$i$>(v) > \exposid{GET}<$i$>(w)} is a valid expression that is
|
6055 | 6053 | convertible to \tcode{bool}, for all $i$.
|
6056 | 6054 |
|
|
6071 | 6069 |
|
6072 | 6070 | \begin{itemdescr}
|
6073 | 6071 | \pnum
|
6074 |
| -\mandates |
| 6072 | +\constraints |
6075 | 6073 | \tcode{\exposid{GET}<$i$>(v) <= \exposid{GET}<$i$>(w)} is a valid expression that is
|
6076 | 6074 | convertible to \tcode{bool}, for all $i$.
|
6077 | 6075 |
|
|
6092 | 6090 |
|
6093 | 6091 | \begin{itemdescr}
|
6094 | 6092 | \pnum
|
6095 |
| -\mandates |
| 6093 | +\constraints |
6096 | 6094 | \tcode{\exposid{GET}<$i$>(v) >= \exposid{GET}<$i$>(w)} is a valid expression that is
|
6097 | 6095 | convertible to \tcode{bool}, for all $i$.
|
6098 | 6096 |
|
|
10999 | 10997 | template<class... ArgTypes>
|
11000 | 10998 | constexpr invoke_result_t<T&, ArgTypes...> operator()(ArgTypes&&...) const
|
11001 | 10999 | noexcept(is_nothrow_invocable_v<T&, ArgTypes...>);
|
| 11000 | + |
| 11001 | + // \ref{refwrap.comparisons}, comparisons |
| 11002 | + friend constexpr bool operator==(reference_wrapper, reference_wrapper); |
| 11003 | + friend constexpr bool operator==(reference_wrapper, const T&); |
| 11004 | + friend constexpr bool operator==(reference_wrapper, reference_wrapper<const T>); |
| 11005 | + |
| 11006 | + friend constexpr @\exposidnc{synth-three-way-result}@<T> operator<=>(reference_wrapper, reference_wrapper); |
| 11007 | + friend constexpr @\exposidnc{synth-three-way-result}@<T> operator<=>(reference_wrapper, const T&); |
| 11008 | + friend constexpr @\exposidnc{synth-three-way-result}@<T> operator<=>(reference_wrapper, |
| 11009 | + reference_wrapper<const T>); |
11002 | 11010 | };
|
11003 | 11011 |
|
11004 | 11012 | template<class T>
|
|
11017 | 11025 | \pnum
|
11018 | 11026 | The template parameter \tcode{T} of \tcode{reference_wrapper}
|
11019 | 11027 | may be an incomplete type.
|
| 11028 | +\begin{note} |
| 11029 | +Using the comparison operators described in subclause \ref{refwrap.comparisons} |
| 11030 | +with \tcode{T} being an incomplete type |
| 11031 | +can lead to an ill-formed program |
| 11032 | +with no diagnostic required\iref{temp.point,temp.constr.atomic}. |
| 11033 | +\end{note} |
11020 | 11034 |
|
11021 | 11035 | \rSec3[refwrap.const]{Constructors}
|
11022 | 11036 |
|
|
11120 | 11134 | \tcode{\placeholdernc{INVOKE}(get(), std::forward<ArgTypes>(args)...)}.\iref{func.require}
|
11121 | 11135 | \end{itemdescr}
|
11122 | 11136 |
|
| 11137 | +\rSec3[refwrap.comparisons]{Comparisons} |
| 11138 | + |
| 11139 | +\begin{itemdecl} |
| 11140 | +friend constexpr bool operator==(reference_wrapper x, reference_wrapper y); |
| 11141 | +\end{itemdecl} |
| 11142 | + |
| 11143 | +\begin{itemdescr} |
| 11144 | +\pnum |
| 11145 | +\constraints |
| 11146 | +The expression \tcode{x.get() == y.get()} is well-formed and |
| 11147 | +its result is convertible to \tcode{bool}. |
| 11148 | + |
| 11149 | +\pnum |
| 11150 | +\returns |
| 11151 | +\tcode{x.get() == y.get()}. |
| 11152 | +\end{itemdescr} |
| 11153 | + |
| 11154 | +\begin{itemdecl} |
| 11155 | +friend constexpr bool operator==(reference_wrapper x, const T& y); |
| 11156 | +\end{itemdecl} |
| 11157 | + |
| 11158 | +\begin{itemdescr} |
| 11159 | +\pnum |
| 11160 | +\constraints |
| 11161 | +The expression \tcode{x.get() == y} is well-formed and |
| 11162 | +its result is convertible to \tcode{bool}. |
| 11163 | + |
| 11164 | +\pnum |
| 11165 | +\returns |
| 11166 | +\tcode{x.get() == y}. |
| 11167 | +\end{itemdescr} |
| 11168 | + |
| 11169 | +\begin{itemdecl} |
| 11170 | +friend constexpr bool operator==(reference_wrapper x, reference_wrapper<const T> y); |
| 11171 | +\end{itemdecl} |
| 11172 | + |
| 11173 | +\begin{itemdescr} |
| 11174 | +\pnum |
| 11175 | +\constraints |
| 11176 | +\tcode{is_const_v<T>} is \tcode{false} and |
| 11177 | +the expression \tcode{x.get() == y.get()} is well-formed and |
| 11178 | +its result is convertible to \tcode{bool}. |
| 11179 | + |
| 11180 | +\pnum |
| 11181 | +\returns |
| 11182 | +\tcode{x.get() == y.get()}. |
| 11183 | +\end{itemdescr} |
| 11184 | + |
| 11185 | +\begin{itemdecl} |
| 11186 | +friend constexpr @\exposidnc{synth-three-way-result}@<T> operator<=>(reference_wrapper x, reference_wrapper y); |
| 11187 | +\end{itemdecl} |
| 11188 | + |
| 11189 | +\begin{itemdescr} |
| 11190 | +\pnum |
| 11191 | +\returns |
| 11192 | +\tcode{\exposid{synth-three-way}(x.get(), y.get())}. |
| 11193 | +\end{itemdescr} |
| 11194 | + |
| 11195 | +\begin{itemdecl} |
| 11196 | +friend constexpr @\exposidnc{synth-three-way-result}@<T> operator<=>(reference_wrapper x, const T& y); |
| 11197 | +\end{itemdecl} |
| 11198 | + |
| 11199 | +\begin{itemdescr} |
| 11200 | +\pnum |
| 11201 | +\returns |
| 11202 | +\tcode{\exposid{synth-three-way}(x.get(), y)}. |
| 11203 | +\end{itemdescr} |
| 11204 | + |
| 11205 | +\begin{itemdecl} |
| 11206 | +friend constexpr @\exposidnc{synth-three-way-result}@<T> operator<=>(reference_wrapper x, |
| 11207 | + reference_wrapper<const T> y); |
| 11208 | +\end{itemdecl} |
| 11209 | + |
| 11210 | +\begin{itemdescr} |
| 11211 | +\pnum |
| 11212 | +\constraints |
| 11213 | +\tcode{is_const_v<T>} is \tcode{false}. |
| 11214 | + |
| 11215 | +\pnum |
| 11216 | +\returns |
| 11217 | +\tcode{\exposid{synth-three-way}(x.get(), y.get())}. |
| 11218 | +\end{itemdescr} |
11123 | 11219 |
|
11124 | 11220 | \rSec3[refwrap.helpers]{Helper functions}
|
11125 | 11221 |
|
|
0 commit comments