Created on 2009-03-12.00:00:00 last changed 101 months ago
Proposed resolution:
This functionality is provided by P0083R3
[ 08-2016, Post-Chicago ]
Move to Tentatively Resolved
[ 2009-10 Santa Cruz: ]
Mark as NAD Future. No consensus to make the change at this time.
Original resolution [SUPERSEDED]:
In [associative.reqmts] Table 85, add:
Table 85 -- Associative container requirements (in addition to container) Expression Return type Assertion/note
pre-/post-conditionComplexity a.erase(q) ... ... ... a.extract(q) pair<key_type, iterator> Extracts the element pointed to by q and erases it from the set. Returns a pair containing the value pointed to by q and an iterator pointing to the element immediately following q prior to the element being erased. If no such element exists, returns a.end(). amortized constant In [unord.req] Table 87, add:
Table 87 -- Unordered associative container requirements (in addition to container) Expression Return type Assertion/note
pre-/post-conditionComplexity a.erase(q) ... ... ... a.extract(q) pair<key_type, iterator> Extracts the element pointed to by q and erases it from the set. Returns a pair containing the value pointed to by q and an iterator pointing to the element immediately following q prior to the element being erased. If no such element exists, returns a.end(). amortized constant
[ 2009-09-20 Howard adds: ]
See the 2009-09-19 comment of 839 for an API which accomplishes this functionality and also addresses several other use cases which this proposal does not.
[ 2009-07 post-Frankfurt: ]
Leave Open. Alisdair to contact Chris Jefferson about this.
[ Post Summit Alisdair adds: ]
Would value_type be a better return type than key_type?
[ Summit: ]
We look forward to a paper on this topic. We recommend no action until a paper is available. The paper would need to address exception safety.
Addresses UK 239 [CD1]
It is not possible to take a move-only key out of an unordered container, such as (multi)set or (multi)map, or the new unordered containers.
Add below a.erase(q), a.extract(q), with the following notation:
a.extract(q)>, Return type pair<key, iterator> Extracts the element pointed to by q and erases it from the set. Returns a pair containing the value pointed to by q and an iterator pointing to the element immediately following q prior to the element being erased. If no such element exists,returns a.end().
History | |||
---|---|---|---|
Date | User | Action | Args |
2016-08-08 15:33:15 | admin | set | messages: + msg8461 |
2016-08-08 15:33:15 | admin | set | status: lewg -> resolved |
2014-11-24 15:11:58 | admin | set | status: nad future -> lewg |
2010-10-21 18:28:33 | admin | set | messages: + msg449 |
2010-10-21 18:28:33 | admin | set | messages: + msg448 |
2010-10-21 18:28:33 | admin | set | messages: + msg447 |
2010-10-21 18:28:33 | admin | set | messages: + msg446 |
2010-10-21 18:28:33 | admin | set | messages: + msg445 |
2010-10-21 18:28:33 | admin | set | messages: + msg444 |
2009-03-12 00:00:00 | admin | create |