Date
2012-08-05.11:46:21
Message id
6090

Content

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 [container.requirements]; as a result, and requirements or contracts for the basic_string interface must be documented in Clause [strings].

Sub-clause [string.swap] defines the swap member function with no requirements, and with 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, [container.requirements.general] p7 declares the behavior of member swap for containers with unequal non-propagating allocators to be undefined.

Resolution proposal:

Additional language from Clause [containers] should probably be copied to Clause [strings]. I will refrain from an exactly recommendation, however, as I am raising further issues related to the language in Clause [containers].