@@ -13978,21 +13978,10 @@
13978
13978
13979
13979
\rSec3[comparisons.three.way]{Class \tcode{compare_three_way}}
13980
13980
13981
- \pnum
13982
- In this subclause, \tcode{\placeholdernc{BUILTIN-PTR-THREE-WAY}(T, U)}
13983
- for types \tcode{T} and \tcode{U} is a boolean constant expression.
13984
- \tcode{\placeholdernc{BUILTIN-PTR-THREE-WAY}(T, U)} is \tcode{true}
13985
- if and only if \tcode{<=>} in the expression
13986
- \begin{codeblock}
13987
- declval<T>() <=> declval<U>()
13988
- \end{codeblock}
13989
- resolves to a built-in operator comparing pointers.
13990
-
13991
13981
\indexlibraryglobal{compare_three_way}%
13992
13982
\begin{codeblock}
13993
13983
struct compare_three_way {
13994
13984
template<class T, class U>
13995
- requires @\libconcept{three_way_comparable_with}@<T, U> || @\placeholdernc{BUILTIN-PTR-THREE-WAY}@(T, U)
13996
13985
constexpr auto operator()(T&& t, U&& u) const;
13997
13986
13998
13987
using is_transparent = @\unspec@;
@@ -14001,17 +13990,21 @@
14001
13990
14002
13991
\begin{itemdecl}
14003
13992
template<class T, class U>
14004
- requires @\libconcept{three_way_comparable_with}@<T, U> || @\placeholdernc{BUILTIN-PTR-THREE-WAY}@(T, U)
14005
13993
constexpr auto operator()(T&& t, U&& u) const;
14006
13994
\end{itemdecl}
14007
13995
14008
13996
\begin{itemdescr}
13997
+ \pnum
13998
+ \constraints
13999
+ \tcode{T} and \tcode{U} satisfy \libconcept{three_way_comparable_with}.
14000
+
14009
14001
\pnum
14010
14002
\expects
14011
14003
If the expression \tcode{std::forward<T>(t) <=> std::forward<U>(u)} results in
14012
14004
a call to a built-in operator \tcode{<=>} comparing pointers of type \tcode{P},
14013
14005
the conversion sequences from both \tcode{T} and \tcode{U} to \tcode{P}
14014
- are equality-preserving\iref{concepts.equality}.
14006
+ are equality-preserving\iref{concepts.equality};
14007
+ otherwise, \tcode{T} and \tcode{U} model \libconcept{three_way_comparable_with}.
14015
14008
14016
14009
\pnum
14017
14010
\effects
@@ -14033,32 +14026,33 @@
14033
14026
14034
14027
\rSec2[range.cmp]{Concept-constrained comparisons}
14035
14028
14036
- \pnum
14037
- In this subclause, \tcode{\placeholdernc{BUILTIN-PTR-CMP}(T, $op$, U)} for types \tcode{T}
14038
- and \tcode{U} and where $op$ is an equality\iref{expr.eq} or relational
14039
- operator\iref{expr.rel} is a boolean constant expression.
14040
- \tcode{\placeholdernc{BUILTIN-PTR-CMP}(T, $op$, U)} is \tcode{true} if and only if $op$
14041
- in the expression \tcode{declval<T>() $op$ declval<U>()} resolves to a built-in
14042
- operator comparing pointers.
14043
-
14044
14029
\indexlibraryglobal{equal_to}%
14045
- \begin{itemdecl }
14030
+ \begin{codeblock }
14046
14031
struct ranges::equal_to {
14047
14032
template<class T, class U>
14048
- requires @\libconcept{equality_comparable_with}@<T, U> || @\placeholdernc{BUILTIN-PTR-CMP}@(T, ==, U)
14049
14033
constexpr bool operator()(T&& t, U&& u) const;
14050
14034
14051
14035
using is_transparent = @\unspecnc@;
14052
14036
};
14037
+ \end{codeblock}
14038
+
14039
+ \begin{itemdecl}
14040
+ template<class T, class U>
14041
+ constexpr bool operator()(T&& t, U&& u) const;
14053
14042
\end{itemdecl}
14054
14043
14055
14044
\begin{itemdescr}
14045
+ \pnum
14046
+ \constraints
14047
+ \tcode{T} and \tcode{U} satisfy \libconcept{equality_comparable_with}.
14048
+
14056
14049
\pnum
14057
14050
\expects
14058
14051
If the expression \tcode{std::forward<T>(t) == std::forward<U>(u)}
14059
14052
results in a call to a built-in operator \tcode{==} comparing pointers of type
14060
14053
\tcode{P}, the conversion sequences from both \tcode{T} and \tcode{U} to \tcode{P}
14061
- are equality-preserving\iref{concepts.equality}.
14054
+ are equality-preserving\iref{concepts.equality};
14055
+ otherwise, \tcode{T} and \tcode{U} model \libconcept{equality_comparable_with}.
14062
14056
14063
14057
\pnum
14064
14058
\effects
@@ -14077,61 +14071,89 @@
14077
14071
\end{itemdescr}
14078
14072
14079
14073
\indexlibraryglobal{not_equal_to}%
14080
- \begin{itemdecl }
14074
+ \begin{codeblock }
14081
14075
struct ranges::not_equal_to {
14082
14076
template<class T, class U>
14083
- requires @\libconcept{equality_comparable_with}@<T, U> || @\placeholdernc{BUILTIN-PTR-CMP}@(T, ==, U)
14084
14077
constexpr bool operator()(T&& t, U&& u) const;
14085
14078
14086
14079
using is_transparent = @\unspecnc@;
14087
14080
};
14081
+ \end{codeblock}
14082
+
14083
+ \begin{itemdecl}
14084
+ template<class T, class U>
14085
+ constexpr bool operator()(T&& t, U&& u) const;
14088
14086
\end{itemdecl}
14089
14087
14090
14088
\begin{itemdescr}
14091
14089
\pnum
14092
- \tcode{operator()} has effects equivalent to:
14090
+ \constraints
14091
+ \tcode{T} and \tcode{U} satisfy \libconcept{equality_comparable_with}.
14092
+
14093
+ \pnum
14094
+ \effects
14095
+ Equivalent to:
14093
14096
\begin{codeblock}
14094
14097
return !ranges::equal_to{}(std::forward<T>(t), std::forward<U>(u));
14095
14098
\end{codeblock}
14096
14099
\end{itemdescr}
14097
14100
14098
14101
\indexlibraryglobal{greater}%
14099
- \begin{itemdecl }
14102
+ \begin{codeblock }
14100
14103
struct ranges::greater {
14101
14104
template<class T, class U>
14102
- requires @\libconcept{totally_ordered_with}@<T, U> || @\placeholdernc{BUILTIN-PTR-CMP}@(U, <, T)
14103
14105
constexpr bool operator()(T&& t, U&& u) const;
14104
14106
14105
14107
using is_transparent = @\unspecnc@;
14106
14108
};
14109
+ \end{codeblock}
14110
+
14111
+ \begin{itemdecl}
14112
+ template<class T, class U>
14113
+ constexpr bool operator()(T&& t, U&& u) const;
14107
14114
\end{itemdecl}
14108
14115
14109
14116
\begin{itemdescr}
14110
14117
\pnum
14111
- \tcode{operator()} has effects equivalent to:
14118
+ \constraints
14119
+ \tcode{T} and \tcode{U} satisfy \libconcept{totally_ordered_with}.
14120
+
14121
+ \pnum
14122
+ \effects
14123
+ Equivalent to:
14112
14124
\begin{codeblock}
14113
14125
return ranges::less{}(std::forward<U>(u), std::forward<T>(t));
14114
14126
\end{codeblock}
14115
14127
\end{itemdescr}
14116
14128
14117
14129
\indexlibraryglobal{less}%
14118
- \begin{itemdecl }
14130
+ \begin{codeblock }
14119
14131
struct ranges::less {
14120
14132
template<class T, class U>
14121
- requires @\libconcept{totally_ordered_with}@<T, U> || @\placeholdernc{BUILTIN-PTR-CMP}@(T, <, U)
14122
14133
constexpr bool operator()(T&& t, U&& u) const;
14123
14134
14124
14135
using is_transparent = @\unspecnc@;
14125
14136
};
14137
+ \end{codeblock}
14138
+
14139
+ \begin{itemdecl}
14140
+ template<class T, class U>
14141
+ constexpr bool operator()(T&& t, U&& u) const;
14126
14142
\end{itemdecl}
14127
14143
14128
14144
\begin{itemdescr}
14145
+ \pnum
14146
+ \constraints
14147
+ \tcode{T} and \tcode{U} satisfy \libconcept{totally_ordered_with}.
14148
+
14129
14149
\pnum
14130
14150
\expects
14131
14151
If the expression \tcode{std::forward<T>(t) < std::forward<U>(u)} results in a
14132
14152
call to a built-in operator \tcode{<} comparing pointers of type \tcode{P}, the
14133
14153
conversion sequences from both \tcode{T} and \tcode{U} to \tcode{P} are
14134
- equality-preserving\iref{concepts.equality}. For any expressions
14154
+ equality-preserving\iref{concepts.equality};
14155
+ otherwise, \tcode{T} and \tcode{U} model \libconcept{totally_ordered_with}.
14156
+ For any expressions
14135
14157
\tcode{ET} and \tcode{EU} such that \tcode{decltype((ET))} is \tcode{T} and
14136
14158
\tcode{decltype((EU))} is \tcode{U}, exactly one of
14137
14159
\tcode{ranges::less\{\}(ET, EU)},
@@ -14156,19 +14178,28 @@
14156
14178
\end{itemdescr}
14157
14179
14158
14180
\indexlibraryglobal{greater_equal}%
14159
- \begin{itemdecl }
14181
+ \begin{codeblock }
14160
14182
struct ranges::greater_equal {
14161
14183
template<class T, class U>
14162
- requires @\libconcept{totally_ordered_with}@<T, U> || @\placeholdernc{BUILTIN-PTR-CMP}@(T, <, U)
14163
14184
constexpr bool operator()(T&& t, U&& u) const;
14164
14185
14165
14186
using is_transparent = @\unspecnc@;
14166
14187
};
14188
+ \end{codeblock}
14189
+
14190
+ \begin{itemdecl}
14191
+ template<class T, class U>
14192
+ constexpr bool operator()(T&& t, U&& u) const;
14167
14193
\end{itemdecl}
14168
14194
14169
14195
\begin{itemdescr}
14170
14196
\pnum
14171
- \tcode{operator()} has effects equivalent to:
14197
+ \constraints
14198
+ \tcode{T} and \tcode{U} satisfy \libconcept{totally_ordered_with}.
14199
+
14200
+ \pnum
14201
+ \effects
14202
+ Equivalent to:
14172
14203
\begin{codeblock}
14173
14204
return !ranges::less{}(std::forward<T>(t), std::forward<U>(u));
14174
14205
\end{codeblock}
@@ -14178,16 +14209,25 @@
14178
14209
\begin{itemdecl}
14179
14210
struct ranges::less_equal {
14180
14211
template<class T, class U>
14181
- requires @\libconcept{totally_ordered_with}@<T, U> || @\placeholdernc{BUILTIN-PTR-CMP}@(U, <, T)
14182
14212
constexpr bool operator()(T&& t, U&& u) const;
14183
14213
14184
14214
using is_transparent = @\unspecnc@;
14185
14215
};
14186
14216
\end{itemdecl}
14187
14217
14218
+ \begin{itemdecl}
14219
+ template<class T, class U>
14220
+ constexpr bool operator()(T&& t, U&& u) const;
14221
+ \end{itemdecl}
14222
+
14188
14223
\begin{itemdescr}
14189
14224
\pnum
14190
- \tcode{operator()} has effects equivalent to:
14225
+ \constraints
14226
+ \tcode{T} and \tcode{U} satisfy \libconcept{totally_ordered_with}.
14227
+
14228
+ \pnum
14229
+ \effects
14230
+ Equivalent to:
14191
14231
\begin{codeblock}
14192
14232
return !ranges::less{}(std::forward<U>(u), std::forward<T>(t));
14193
14233
\end{codeblock}
0 commit comments