Boost logo

Boost :

Subject: Re: [boost] [string] proposal
From: Artyom (artyomtnk_at_[hidden])
Date: 2011-01-24 06:50:56


> From: Dave Abrahams <dave_at_[hidden]>
> On Fri, Jan 21, 2011 at 4:31 PM, Nevin Liber <nevin_at_[hidden]> wrote:
> > On 21 January 2011 10:55, Dave Abrahams <dave_at_[hidden]> wrote:
> >
> >>
> >> Do you want to prevent
> >> 1. wholesale mutation such as
> >>
> >> x = y
> >> x += y
> >>
> >> or just
> >>
> >> 2. per-char mutation such as
> >>
> >> x[10] = 'a'
> >>
> >> ?
> >>
> >
> > Eliminating #2 but not #1 would force c_str() to make a (possibly tracked)
> > copy, to avoid #2 on its internal buffer (due to the trailing '\0' byte).
>
> Who says we need a c_str()?
>

Almost everybody who uses any kind of API that does not has direct uses
of this string and this is as almost every API around...

Artyom

      


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk