Title
basic_string<>::swap semantics ignore allocators
Status
resolved
Section
[string.require]
Submitter
Robert Shearer

Created on 2012-04-13.00:00:00 last changed 73 months ago

Messages

Date: 2013-03-15.00:00:00

[ 2013-03-15 Issues Teleconference ]

Moved to Open.

Alisdair has offered to provide wording.

Telecon notes that [container.requirements.general]p13 says that string is an allocator-aware container.

Resolved by the adoption of P1148 in San Diego.

Date: 2012-08-05.11:46:21

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].

History
Date User Action Args
2018-11-25 18:34:32adminsetstatus: open -> resolved
2013-03-18 14:33:00adminsetmessages: + msg6407
2013-03-18 13:02:36adminsetstatus: new -> open
2012-08-05 11:46:21adminsetmessages: + msg6090
2012-04-13 00:00:00admincreate