Skip to content

Commit cbd19c5

Browse files
authored
Merge 2019-11 LWG Motion 21
P1959R0 Remove std::weak_equality and std::strong_equality
2 parents eda1581 + ab483d4 commit cbd19c5

File tree

6 files changed

+40
-291
lines changed

6 files changed

+40
-291
lines changed

source/basic.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4974,7 +4974,7 @@
49744974
\end{note}
49754975
The type of a pointer that can designate a function
49764976
is called a \defn{function pointer type}.
4977-
A pointer to objects of type \tcode{T} is referred to as a ``pointer to
4977+
A pointer to an object of type \tcode{T} is referred to as a ``pointer to
49784978
\tcode{T}''.
49794979
\begin{example}
49804980
A pointer to an object of type \tcode{int} is

source/classes.tex

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6816,18 +6816,6 @@
68166816
partial_ordering::unordered
68176817
\end{codeblock}
68186818

6819-
\item
6820-
Otherwise, if \tcode{R} is \tcode{strong_equality}, then
6821-
\begin{codeblock}
6822-
a == b ? strong_equality::equal : strong_equality::nonequal
6823-
\end{codeblock}
6824-
6825-
\item
6826-
Otherwise, if \tcode{R} is \tcode{weak_equality}, then
6827-
\begin{codeblock}
6828-
a == b ? weak_equality::equivalent : weak_equality::nonequivalent
6829-
\end{codeblock}
6830-
68316819
\item
68326820
Otherwise, the synthesized three-way comparison is not defined.
68336821
\end{itemize}
@@ -6889,18 +6877,6 @@
68896877
is not a comparison category type\iref{cmp.categories},
68906878
\tcode{U} is \tcode{void}.
68916879

6892-
\item
6893-
Otherwise, if
6894-
at least one $\tcode{T}_i$ is \tcode{std::weak_equality}, or
6895-
at least one $\tcode{T}_i$ is \tcode{std::strong_equality} and
6896-
at least one $\tcode{T}_j$ is \tcode{std::partial_ordering} or
6897-
\tcode{std::weak_ordering},
6898-
\tcode{U} is \tcode{std::weak_equality}\iref{cmp.weakeq}.
6899-
6900-
\item
6901-
Otherwise, if at least one $\tcode{T}_i$ is \tcode{std::strong_equality},
6902-
\tcode{U} is \tcode{std::strong_equality}\iref{cmp.strongeq}.
6903-
69046880
\item
69056881
Otherwise, if at least one $\tcode{T}_i$ is \tcode{std::partial_ordering},
69066882
\tcode{U} is \tcode{std::partial_ordering}\iref{cmp.partialord}.
@@ -6944,8 +6920,10 @@
69446920
\pnum
69456921
\begin{example}
69466922
\begin{codeblock}
6923+
struct HasNoLessThan { };
6924+
69476925
struct C {
6948-
friend std::strong_equality operator<=>(const C&, const C&);
6926+
friend HasNoLessThan operator<=>(const C&, const C&);
69496927
bool operator<(const C&) const = default; // OK, function is deleted
69506928
};
69516929
\end{codeblock}

source/expressions.tex

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5955,20 +5955,6 @@
59555955
array-to-pointer conversions\iref{conv.array} are not applied.
59565956
\end{note}
59575957

5958-
\pnum
5959-
If the composite pointer type is
5960-
a function pointer type,
5961-
a pointer-to-member type, or
5962-
\tcode{std::nullptr_t},
5963-
the result is of type \tcode{std::strong_equality};
5964-
the result is
5965-
\tcode{std::strong_equality::equal}
5966-
if the (possibly converted) operands compare equal\iref{expr.eq}
5967-
and
5968-
\tcode{std::strong_equality::nonequal}
5969-
if they compare unequal,
5970-
otherwise the result of the operator is unspecified.
5971-
59725958
\pnum
59735959
If the composite pointer type is an object pointer type,
59745960
\tcode{p <=> q} is of type \tcode{std::strong_ordering}.
@@ -5987,12 +5973,10 @@
59875973
Otherwise, the program is ill-formed.
59885974

59895975
\pnum
5990-
The five comparison category types\iref{cmp.categories}
5976+
The three comparison category types\iref{cmp.categories}
59915977
(the types
59925978
\tcode{std::strong_ordering},
5993-
\tcode{std::strong_equality},
5994-
\tcode{std::weak_ordering},
5995-
\tcode{std::weak_equality}, and
5979+
\tcode{std::weak_ordering}, and
59965980
\tcode{std::partial_ordering})
59975981
are not predefined;
59985982
if the header \libheaderref{compare}

source/iterators.tex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@
295295
constexpr bool operator>=(
296296
const reverse_iterator<Iterator1>& x,
297297
const reverse_iterator<Iterator2>& y);
298-
template<class Iterator1, three_way_comparable_with<Iterator1, weak_equality> Iterator2>
298+
template<class Iterator1, three_way_comparable_with<Iterator1> Iterator2>
299299
constexpr compare_three_way_result_t<Iterator1, Iterator2>
300300
operator<=>(const reverse_iterator<Iterator1>& x,
301301
const reverse_iterator<Iterator2>& y);
@@ -350,7 +350,7 @@
350350
template<class Iterator1, class Iterator2>
351351
constexpr bool operator>=(
352352
const move_iterator<Iterator1>& x, const move_iterator<Iterator2>& y);
353-
template<class Iterator1, three_way_comparable_with<Iterator1, weak_equality> Iterator2>
353+
template<class Iterator1, three_way_comparable_with<Iterator1> Iterator2>
354354
constexpr compare_three_way_result_t<Iterator1, Iterator2>
355355
operator<=>(const move_iterator<Iterator1>& x,
356356
const move_iterator<Iterator2>& y);
@@ -3526,7 +3526,7 @@
35263526

35273527
\indexlibrarymember{operator<=>}{reverse_iterator}%
35283528
\begin{itemdecl}
3529-
template<class Iterator1, three_way_comparable_with<Iterator1, weak_equality> Iterator2>
3529+
template<class Iterator1, three_way_comparable_with<Iterator1> Iterator2>
35303530
constexpr compare_three_way_result_t<Iterator1, Iterator2>
35313531
operator<=>(const reverse_iterator<Iterator1>& x,
35323532
const reverse_iterator<Iterator2>& y);
@@ -4470,7 +4470,7 @@
44704470

44714471
\indexlibrarymember{operator<=>}{move_iterator}%
44724472
\begin{itemdecl}
4473-
template<class Iterator1, three_way_comparable_with<Iterator1, weak_equality> Iterator2>
4473+
template<class Iterator1, three_way_comparable_with<Iterator1> Iterator2>
44744474
constexpr compare_three_way_result_t<Iterator1, Iterator2>
44754475
operator<=>(const move_iterator<Iterator1>& x,
44764476
const move_iterator<Iterator2>& y);

source/overloading.tex

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4114,9 +4114,8 @@
41144114
is a pointer-to-member type or \tcode{std::nullptr_t},
41154115
there exist candidate operator functions of the form
41164116
\begin{codeblock}
4117-
bool operator==(@\placeholder{T}@, @\placeholder{T}@);
4118-
bool operator!=(@\placeholder{T}@, @\placeholder{T}@);
4119-
std::strong_equality operator<=>(@\placeholder{T}@, @\placeholder{T}@);
4117+
bool operator==(@\placeholder{T}@, @\placeholder{T}@);
4118+
bool operator!=(@\placeholder{T}@, @\placeholder{T}@);
41204119
\end{codeblock}
41214120

41224121
\pnum

0 commit comments

Comments
 (0)