
2. In the case that you do have strings copied around, consider the case in multi-threaded applications where you have different threads running on different cores.
Copying the string data outweighs the reference count update because of the allocation.
Right.
So I guess I can be convinced that ref counting in strings would be just fine.
I can't wait to get that so that I can make cpp-netlib just use these smart strings throughout. :D
If it's just for a std::string compatible class being implemented the way you like it (COW, value semantics, reference counting, or plain old data copying, etc.), you might want to look at flex_string, a policy based std::string equivalent (here: http://loki-lib.svn.sourceforge.net/viewvc/loki-lib/trunk/include/loki/flex/ , also part of wave). Regards Hartmut --------------- http://boost-spirit.com