40inline NumberType
toNumber(std::string numberString)
42 if(numberString.substr(0, 4).compare(
"true") == 0)
return 1;
43 else if(numberString.substr(0, 4).compare(
"false") == 0)
return 0;
45 std::istringstream converter(numberString);
47 if(
typeid(NumberType)==
typeid(
bool))
50 return (converter >> result).fail() ? false : !!result;
54 return (converter >> result).fail() ? 0 : result;