How to check if a std::string is set or not?

Viewed 157174

If using a char*, I can initialize it to NULL and later check if it is set by doing a comparison. How to do the same thing for a std::string? How to check if the string is set or not?

EDIT: What if the string I set to is also empty? Do I have to use an additional flag to check if the std::string is set or not?

6 Answers
Related