Proper writing with std::string