>>107737390
>>107735617
Yea I don't think this code has any dangling references because operator+ between a std string and char* performs a copy, so it would either call the copy assignment or copy constructor.
std::string s = widget.name() + ".txt"; // temporary is copied to s
openFile(s); // completely fine