This page is a snapshot from the LWG issues list, see theLibrary Active Issues List for more information and the meaning ofResolved status.
basic_string<>::swap semantics ignore allocatorsSection: 27.4.3.2[string.require]Status:ResolvedSubmitter: Robert ShearerOpened: 2012-04-13Last modified: 2018-11-25
Priority:3
View all otherissues in [string.require].
View all issues withResolved status.
Discussion:
In C++11,basic_string is not described as a "container", and is not governed by the allocator-aware container semantics described in sub-clause 23.2[container.requirements]; as a result, and requirements or contracts for thebasic_string interface must be documented in Clause 27[strings].
swap member function with no requirements, andwith guarantees to execute in constant time without throwing. Fulfilling such a contract is not reasonable in the presence of unequal non-propagating allocators.In contrast, 23.2.2[container.requirements.general] p7 declares the behavior of memberswap for containers with unequal non-propagating allocators to be undefined.Resolution proposal:Additional language from Clause 23[containers] should probably be copied to Clause 27[strings]. I will refrain from an exactly recommendation, however, as I am raising furtherissues related to the language in Clause 23[containers].[2013-03-15 Issues Teleconference]
Moved to Open.
Alisdair has offered to provide wording.
Telecon notes that 23.2.2[container.requirements.general]p13 says thatstring is anallocator-aware container.
Resolved by the adoption ofP1148 in San Diego.
Proposed resolution: