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
Here's a way similar to Kyle's except it handles the leading zeroes and stuff:
bool to_bool(std::string const& s) { return atoi(s.c_str()); }