What is the best way to convert a std::string to bool? I am calling a function that returns either \"0\" or \"1\", and I need a clean solution for turning this into a boole
It'll probably be overkill for you, but I'd use boost::lexical_cast
boost::lexical_cast("1") // returns true boost::lexical_cast("0") // returns false