Created on 2019-08-06.00:00:00 last changed 45 months ago
Proposed resolution:
This wording is relative to N4830.
Modify [stoptoken], class stop_token synopsis, as indicated:
namespace std { class stop_token { public: […] [[nodiscard]] friend bool operator==(const stop_token& lhs, const stop_token& rhs) noexcept;[[nodiscard]] friend bool operator!=(const stop_token& lhs, const stop_token& rhs) noexcept;friend void swap(stop_token& lhs, stop_token& rhs) noexcept; }; }
Modify [stoptoken.cmp] and [stoptoken.special] as indicated:
32.3.3.3 Non-member functions
Comparisons[stoptoken.nonmemberscmp][[nodiscard]] bool operator==(const stop_token& lhs, const stop_token& rhs) noexcept;-1- Returns: true if lhs and rhs have ownership of the same stop state or if both lhs and rhs do not have ownership of a stop state; otherwise false.
[[nodiscard]] bool operator!=(const stop_token& lhs, const stop_token& rhs) noexcept;
-2- Returns: !(lhs==rhs).
32.3.3.4 Specialized algorithms [stoptoken.special]friend void swap(stop_token& x, stop_token& y) noexcept;-1- Effects: Equivalent to: x.swap(y).
[ 01-2020 Moved to Tentatively Ready after 5 positive votes on the reflector. ]
In the shiny new world of the future, we need not declare overloads of operator!= that return !(x == y); the rewrite rule in [over.match.oper] para 3.4.3 achieves the same effect. Consequently, we should not declare such unnecessary operator!= overloads. The synopsis of class stop_token in [stoptoken] declares exactly such an operator!= friend which should be struck.
History | |||
---|---|---|---|
Date | User | Action | Args |
2021-02-25 10:48:01 | admin | set | status: wp -> c++20 |
2020-02-24 16:02:59 | admin | set | status: voting -> wp |
2020-01-17 04:54:50 | admin | set | status: ready -> voting |
2020-01-05 16:13:01 | admin | set | messages: + msg10905 |
2020-01-05 16:13:01 | admin | set | status: new -> ready |
2019-08-17 14:16:58 | admin | set | messages: + msg10559 |
2019-08-06 00:00:00 | admin | create |