Skip to content

[libc++] Should std::flat_set::insert construct a temporary value in its implementation? #119016

@ldionne

Description

@ldionne

From https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2767r2.html#insert-emplace:

std::pmr::set_default_resource(std::pmr::null_memory_resource());
std::pmr::monotonic_buffer_resource mr(1000000);

auto fm = PmrFlatSet<std::pmr::string>(&mr);
std::pmr::string ps("too long to fit in the small string buffer", &mr);
fm.insert(ps);
  // Before: runtime abort, cannot default-allocate t
  // After: OK

I don't know how libc++ handles this today and I don't know what we want to do with it, but we must investigate and decide on something.

Metadata

Metadata

Assignees

Labels

libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.test-suite

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions