Skip to content

Conversation

@frederick-vs-ja
Copy link
Contributor

@frederick-vs-ja frederick-vs-ja commented Dec 22, 2025

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.

Unblocked libcxx tests:

  • std/containers/container.adaptors/flat.set/flat.set.modifiers/emplace_hint.pass.cpp
  • std/containers/container.adaptors/flat.set/flat.set.modifiers/emplace.pass.cpp
  • std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_cv.pass.cpp
  • std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_iter_cv.pass.cpp
  • std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_iter_rv.pass.cpp
  • std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_rv.pass.cpp
  • std/containers/container.adaptors/flat.set/flat.set.modifiers/insert_transparent.pass.cpp (for Clang only, due to MSVC not implementing WG21-P2448R2)

Fixes #5538.

@frederick-vs-ja frederick-vs-ja requested a review from a team as a code owner December 22, 2025 01:48
@github-project-automation github-project-automation bot moved this to Initial Review in STL Code Reviews Dec 22, 2025
@frederick-vs-ja frederick-vs-ja changed the title <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 Dec 22, 2025
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Initial Review

Development

Successfully merging this pull request may close these issues.

2 participants