Created on 2022-11-08.00:00:00 last changed 13 months ago
Proposed resolution:
This wording is relative to N4917.
Modify [flat.map.overview] as indicated:
-7- Any
sequence container ([sequence.reqmts])type Csupporting Cpp17RandomAccessIteratorthat meets sequence container requirements ([sequence.reqmts]) can be used to instantiate flat_map, as long as C::iterator meets the Cpp17RandomAccessIterator requirements and invocations of member functions C::size and C::max_size do not exit via an exception. In particular, vector ([vector]) and deque ([deque]) can be used.
Modify [flat.multimap.overview] as indicated:
-7- Any
sequence container ([sequence.reqmts])type Csupporting Cpp17RandomAccessIteratorthat meets sequence container requirements ([sequence.reqmts]) can be used to instantiate flat_multimap, as long as C::iterator meets the Cpp17RandomAccessIterator requirements and invocations of member functions C::size and C::max_size do not exit via an exception. In particular, vector ([vector]) and deque ([deque]) can be used.
[ 2022-11-12 Approved at November 2022 meeting in Kona. Status changed: Immediate → WP. ]
[ Kona 2022-11-08; Move to Immediate status ]
This is resolution of US 42-103 ([flat.map.overview] p6 [flat.multimap.overview] p6 Clearing when restoring invariants).
Currently both [flat.map.overview] p7 and [flat.multimap.overview] p7 claims that flat_(multi)map supports "Any sequence container ([sequence.reqmts]) C supporting Cpp17RandomAccessIterator", which arguably includes std::array (see LWG 617). This is incorrect as std::array does not provide operations required to restored these adaptors invariant, including clear. We should require that C meets sequence container requirements, and we state that fact explicitly in [array.overview] p3: "An array meets some of the requirements of a sequence container ([sequence.reqmts])".
History | |||
---|---|---|---|
Date | User | Action | Args |
2023-11-22 15:47:43 | admin | set | status: wp -> c++23 |
2022-11-17 00:42:33 | admin | set | messages: + msg13094 |
2022-11-17 00:42:33 | admin | set | status: immediate -> wp |
2022-11-08 22:46:43 | admin | set | messages: + msg12967 |
2022-11-08 22:46:43 | admin | set | status: new -> immediate |
2022-11-08 16:38:45 | admin | set | messages: + msg12959 |
2022-11-08 00:00:00 | admin | create |