Boost logo

Boost :

From: Martin Bonner (Martin.Bonner_at_[hidden])
Date: 2007-08-10 04:22:26


loufoque wrote:

> Hervé Brönnimann wrote:
>> A shared string would be *extremely* useful. Most of the projects
>> I'm working on these days spend a non-negligible time copying
>> strings... FWIW, HB

> Libraries that produce needless copies are simply ill-designed,
The obvious case is return by value. I know that there are some compiler optimizations that can help here, but we have to work with the compilers we have.

The other case is standard containers (and yes, I know I snipped your comment that the standard library is badly designed). Until we have a C++09 compiler that supports move, maps etc involve a lot of copying.

> - Sharing, if used, works way better with immutable objects.
Well yes. I don't know about Hervé, but I would have thought a shared string class would indeed be immutable

-- 
Martin Bonner
Project Leader
PI SHURLOK LTD
Telephone: +44 1223 441434 / 203894 (direct)
Fax: +44 1223 203999
Email: martin.bonner_at_[hidden]
www.pi-shurlok.com
disclaimer

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