Boost logo

Boost :

From: Nigel Stewart (ns_at_[hidden])
Date: 2006-03-06 12:30:42


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

     Has there been any boost proposal for alternative strings
     to std::string?

Nigel


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