I've seen various conflicting references to the copy constructor behaviour of STL strings in C++ and I was hoping someone could clarify this for me, given the following code segment:
string str() { return string("this is a string"); }
//meanwhile, in some other function...
string s = str();
Does the object 's' constitute a deep copy of the string object defined in the function 'str()'? or is the object 's' simply pointing at the same chunk of memory allocated during the string constructor call in the 'str()' function?