Imagine this little simplified code snip:
ostringstream os;
os << "hello world!";
string str = os.str().c_str(); // copy of os
list<string> lst;
lst.push_back(str); // copy of str
In WideString there is a function called detach() which gives the responsibility to the called function to handle the mem-allocations.
Is there such a simlar trick for string type?