Implementation of the string& operator= (const string& str)