On Sun, Aug 20, 2006 at 11:34:43AM +0200, Abdelrazak Younes wrote: > >>There's an added benefit if we go the basic_string way: I think most > >>compilers (gcc, msvc) now do implicit sharing on strings so passing > >>parameters won't be as costly as with std::vector(). > > > >I doubt any recent compiler does implicit sharing on strings. > > I meant the STL library packaged with the compiler.
Neither those. I wasn't nitpicking. Efficient threadsafe implicit sharing while fulfilling all languange requirements seems to be impossible. The only efficient and 'commonly' deployed optimization seems to be storings 'small' strings (i.e. up to 16 or 32 bytes) directly in the object, not on the heap. Andre'