3752. Should string::substr forward the allocator to the newly created string?

Section: [string.substr] Status: NAD Submitter: Igor Zhukov Opened: 2022-08-10 Last modified: 2022-11-30 17:59:24 UTC

Priority: Not Prioritized

View all issues with NAD status.


Adrian Vogelsgesang noticed that libcxx's string::substr forward the allocator to the newly created string.

Nikolas Klauser found that MSVC STL does the same thing.

While Casey Carter and we all agree that this is a bug and we will fix it, we've "always" been nonconforming here and it's weird though that there was never an issue filed and two implementations have the exact same change.

So we want a clarification from LWG.

[2022-08-24; Reflector poll]

Set status to Tentatively NAD after reflector poll.

"If you want to provide a different allocator, you can use the substring constructor."

"This matches the constructor, whose choice of allocator has been already considered in 2402. Any changes here need a paper."

[2022-11-30 LWG telecon. Status changed: Tentatively NAD → NAD.]

Proposed resolution: