This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of NAD Editorial status.
basic_string
is not a sequenceSection: 27.4.3 [basic.string] Status: NAD Editorial Submitter: Bo Persson Opened: 2007-08-18 Last modified: 2016-01-28
Priority: Not Prioritized
View other active issues in [basic.string].
View all other issues in [basic.string].
View all issues with NAD Editorial status.
Discussion:
Paragraph 27.4.3 [basic.string]/3 states:
The class template
basic_string
conforms to the requirements for a Sequence (23.1.1) and for a Reversible Container (23.1).
First of all, 23.2.4 [sequence.reqmts] is no longer "Sequence" but "Sequence container".
Secondly, after the resent changes to containers (emplace
, push_back
,
const_iterator
parameters to insert
and erase
), basic_string
is not
even close to conform to the current requirements.
[ Bellevue: ]
- emplace, for example, may not make sense for strings. Is also likely suboptimal
- with concepts do we need to maintain string as sequence container?
- One approach might be to say something like: string is a sequence except it doesn't have these functions
- basic_string already has push_back
- const_iterator parameters to insert and erase should be added to basic_string
- this leaves emplace to handle -- we have the following options:
- option 1: add it to string even though it's optional
- option 2: make emplace optional to sequences (move from table 89 to 90)
- option 3: say string not sequence (the proposal),
- option 4: add an exception to basic string wording.
General consensus is to suggest option 2.
[ 2009-07 Frankfurt: ]
Move to NAD Editorial
Proposed resolution:
Remove this sentence, in recognition of the fact that basic_string
is
not just a vector
-light for literal types, but something quite
different, a string abstraction in its own right.