I\'m having an issue trying to check against multiple possibilities in an if statement.
The user inputs a string, and then I check that string against multiple possi
Using std::set and c++11 you can do one liner with similar syntax as your.
check this:
#include
#include
#include
int main()
{
if( (std::set{"Seven", "seven", "7"}).count("seven") )
{
std::cout << "foo\n";
}
std::string theString("6");
if( (std::set{"Six", "six", "6"}).count(theString) )
{
std::cout << "bar\n";
}
}