Topic: basic_string not a sequence


Author: Matt Austern <austern@sgi.com>
Date: 1997/01/13
Raw View
Bill Dimm <billd@gim.net> writes:

> Looking at the Apr 95 ANSI Draft (sorry if this is obsolete,
> my Dec 96 is [hopefully] crawling through the mail...), it seems
> that basic_string satisfies most, but not all sequence container
> requirements listed in section 23.1.1.  So, why are things
> like 'erase', and 'push_back' (optional) missing from basic_string?

As defined in CD-2, basic_string has erase() but not push_back().

What you have to remember is that a string class predates the
inclusion of the STL into the C++ standard.  The string class was
modified to make it more consistent with the STL, but it still shows
definite signs of a different ancestry.  For example, basic_string
contains several algorithms that are, strictly speaking, redundant:
they duplicate general-purpose algorithms defined in chapter 25.
---
[ comp.std.c++ is moderated.  To submit articles: Try just posting with your
                newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu
]





Author: Bill Dimm <billd@gim.net>
Date: 1997/01/13
Raw View
Looking at the Apr 95 ANSI Draft (sorry if this is obsolete,
my Dec 96 is [hopefully] crawling through the mail...), it seems
that basic_string satisfies most, but not all sequence container
requirements listed in section 23.1.1.  So, why are things
like 'erase', and 'push_back' (optional) missing from basic_string?

Thanks,
  Bill Dimm
---
[ comp.std.c++ is moderated.  To submit articles: Try just posting with your
                newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu
]