Title
LWG 2059 added overloads that might be ill-formed for sets
Status
c++23
Section
[set.overview][multiset.overview] [unord.set.overview][unord.multiset.overview]
Submitter
Jonathan Wakely

Created on 2022-05-25.00:00:00 last changed 12 months ago

Messages

Date: 2022-07-25.20:32:58

Proposed resolution:

This wording is relative to N4910.

  1. Modify [set.overview], class template set synopsis, as indicated:

    iterator erase(iterator position) requires (!same_as<iterator, const_iterator>);
    iterator erase(const_iterator position);
    
  2. Modify [multiset.overview], class template multiset synopsis, as indicated:

    iterator erase(iterator position) requires (!same_as<iterator, const_iterator>);
    iterator erase(const_iterator position);
    
  3. Modify [unord.set.overview], class template unordered_set synopsis, as indicated:

    iterator erase(iterator position) requires (!same_as<iterator, const_iterator>);
    iterator erase(const_iterator position);
    
  4. Modify [unord.multiset.overview], class template unordered_multiset synopsis, as indicated:

    iterator erase(iterator position) requires (!same_as<iterator, const_iterator>);
    iterator erase(const_iterator position);
    
Date: 2022-07-25.00:00:00

[ 2022-07-25 Approved at July 2022 virtual plenary. Status changed: Ready → WP. ]

Date: 2022-07-15.00:00:00

[ 2022-07-15; LWG telecon: move to Ready ]

Date: 2022-06-15.00:00:00

[ 2022-06-21; Reflector poll ]

Set status to Tentatively Ready after seven votes in favour during reflector poll.

Date: 2022-06-06.16:33:55

The restored erase(iterator) overloads introduced by LWG 2059 would be duplicates of the erase(const_iterator) ones if iterator and const_iterator are the same type, which is allowed for sets.

We should constrain them (or add prose) so that the erase(iterator) overloads are only present when the iterator types are distinct.

This applies to set, multiset, unordered_set, unordered_multiset (and flat_set and flat_multiset).

History
Date User Action Args
2023-11-22 15:47:43adminsetstatus: wp -> c++23
2022-07-25 20:32:58adminsetmessages: + msg12646
2022-07-25 20:32:58adminsetstatus: ready -> wp
2022-07-25 20:28:19adminsetmessages: + msg12620
2022-06-21 11:47:28adminsetmessages: + msg12516
2022-06-21 11:47:28adminsetstatus: new -> ready
2022-05-29 09:25:19adminsetmessages: + msg12480
2022-05-25 00:00:00admincreate