-
Notifications
You must be signed in to change notification settings - Fork 1.6k
<flat_set>: Make flat_(multi)set insertion exception-safe for non-standard sequence containers
#5972
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
<flat_set>: Make flat_(multi)set insertion exception-safe for non-standard sequence containers
#5972
Conversation
<flat_set>: Make flat_(multi)set` insertion exception-safe for non-standard sequence containers<flat_set>: Make flat_(multi)set insertion exception-safe for non-standard sequence containers
…ence containers Per N5032 [container.reqmts]/66.1, exception safety of single element insertion is only guaranteed for standard containers. So perhaps we should guard the insertion for non-standard containers that do not have guaranteed (exception-safe) `emplace`. The `emplace` calls are only guarded for containers whose `emplace` have no guaranteed exception safety. Currently, all supported standard containers have such exception safety, so this only affects non-standard containers.
4b62bce to
538400d
Compare
|
There are similar single-element insertion operations in This seems like the exact same case Lines 951 to 956 in 18e1eb5
This could maybe be a candidate, since we are repeatedly using a single-element insertion function? Lines 1055 to 1075 in 18e1eb5
In both cases, couldn't we relax our reaction a little bit and only clear the whole |
|
@vmichal I don't think this is applicable to |
Per N5032 [container.reqmts]/66.1, exception safety of single element insertion is only guaranteed for standard containers. So perhaps we should guard the insertion for non-standard containers that do not have guaranteed (exception-safe)
emplace.The
emplacecalls are only guarded for containers whoseemplacehave no guaranteed exception safety. Currently, all supported standard containers have such exception safety, so this only affects non-standard containers.Unblocked libcxx tests:
std/containers/container.adaptors/flat.set/flat.set.modifiers/emplace_hint.pass.cppstd/containers/container.adaptors/flat.set/flat.set.modifiers/emplace.pass.cppstd/containers/container.adaptors/flat.set/flat.set.modifiers/insert_cv.pass.cppstd/containers/container.adaptors/flat.set/flat.set.modifiers/insert_iter_cv.pass.cppstd/containers/container.adaptors/flat.set/flat.set.modifiers/insert_iter_rv.pass.cppstd/containers/container.adaptors/flat.set/flat.set.modifiers/insert_rv.pass.cppstd/containers/container.adaptors/flat.set/flat.set.modifiers/insert_transparent.pass.cpp(for Clang only, due to MSVC not implementing WG21-P2448R2)Fixes #5538.