If the cards variable is a std::string, then the comparison is valid, since the string literal can be implictly cast to a std::string.