1. clear() doesn't seem to be a member of std::basic_string, does it?
2. you don't need something like clear() there, as the string is empty.