Title
basic_string is not a sequence
Status
nad editorial
Section
[basic.string]
Submitter
Bo Persson

Created on 2007-08-18.00:00:00 last changed 172 months ago

Messages

Date: 2010-10-21.18:28:33

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.

Date: 2010-10-21.18:28:33

[ 2009-07 Frankfurt: ]

Move to NAD Editorial

Date: 2010-10-21.18:28:33

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

Date: 2007-08-18.00:00:00

Paragraph [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, [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.

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg3531
2010-10-21 18:28:33adminsetmessages: + msg3530
2010-10-21 18:28:33adminsetmessages: + msg3529
2007-08-18 00:00:00admincreate