Boost logo

Boost :

From: Caleb Epstein (caleb.epstein_at_[hidden])
Date: 2006-03-06 13:18:16


On 3/6/06, Nigel Stewart <ns_at_[hidden]> wrote:
>
> > But I think that filling a string instead of returning a temporary one
> > is always faster. And there is another reason for avoiding allocation
> > apart from speed: memory fragmentation.
>
> Something not yet mentioned in this thread - the Qt QString provides
> a reference-counted "shallow-copy", (deep-copy on modification)
> mechanism that makes QString a lot more efficient than std::string
> in this kind of situation. Copying a QString is cheap, and
> sizeof(QString)==sizeof(int).

GNU's libstdc++'s std::string is reference counted as well.

     Has there been any boost proposal for alternative strings

> to std::string?

There was a fixed_string library that was reviewed recently, but it was
rejected.

--
Caleb Epstein
caleb dot epstein at gmail dot com

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