Title
Strike stop_source's operator!=
Status
c++20
Section
[stopsource]
Submitter
Tim Song

Created on 2020-01-03.00:00:00 last changed 38 months ago

Messages

Date: 2020-01-14.12:59:29

Proposed resolution:

This wording is relative to N4842.

  1. Modify [stopsource], class stop_source synopsis, as indicated:

    namespace std {
      […]
    
      class stop_source {
      public:
        […]
    
        [[nodiscard]] friend bool
        operator==(const stop_source& lhs, const stop_source& rhs) noexcept;
        [[nodiscard]] friend bool
        operator!=(const stop_source& lhs, const stop_source& rhs) noexcept;
        friend void swap(stop_source& lhs, stop_source& rhs) noexcept;
      };
    }
    
  2. Modify [stopsource.cmp] and [stopsource.special] as indicated:

    32.3.4.3 Non-member functionsComparisons [stopsource.nonmemberscmp]

    [[nodiscard]] bool operator==(const stop_source& lhs, const stop_source& 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_source& lhs, const stop_source& rhs) noexcept;
    

    -2- Returns: !(lhs==rhs).

    32.3.4.4 Specialized algorithms [stopsource.special]

    friend void swap(stop_source& x, stop_source& y) noexcept;
    

    -1- Effects: Equivalent to: x.swap(y).

Date: 2020-01-14.00:00:00

[ 2020-01-14 Status set to Tentatively Ready after six positive votes on the reflector. ]

Date: 2020-01-03.00:00:00

Just like stop_token (see LWG 3254), stop_source in [stopsource] declares an operator!= friend that is unnecessary in light of the new core language rules and should be struck.

History
Date User Action Args
2021-02-25 10:48:01adminsetstatus: wp -> c++20
2020-02-24 16:02:59adminsetstatus: immediate -> wp
2020-02-14 06:37:09adminsetstatus: ready -> immediate
2020-01-14 12:59:29adminsetmessages: + msg10930
2020-01-14 12:59:29adminsetstatus: new -> ready
2020-01-03 04:31:29adminsetmessages: + msg10904
2020-01-03 00:00:00admincreate