Difficulties in implementing flat_meow
's exception guarantees
#4059
Labels
flat_meow
C++23 container adaptors
LWG issue needed
A wording defect that should be submitted to LWG as a new issue
resolved
Successfully resolved without a commit
I find it very hard to meet the exception guarantees for
flat_meow
(takeflat_set
for example below).According to this,
flat_set
should meet the exception guarantees specified inflat_set
relies on its underlying containers to doinsert
anderase
. So, the above requirements also imply:A. The container should not throw on
erase(iter)
.~ However, this is not true for
deque
andvector
:B. The container should provide strong guarantee for
insert(iter,single-element)
.~ However, for example, this is not required by
deque
. The wordings doesn't specify the effects when not inserting at beginning or end.I think the standard should give explicit specifications for exception guarantees for
flat_meow::insert/erase
. What's more, this is also related toflat_meow
's invariant guarantee against exceptions. As different containers provides different level of exception guarantee, what shouldflat_meow
behave when an exception of unknown effect occurs ininsert/erase
functions?The text was updated successfully, but these errors were encountered: