I need to evaluate simple Boolean functions at run time in C++. The functions are read from a file as strings. Is there any library available that I could use for this?
I looked into BuDDy but sounds like it doesn't parse strings.
I need to evaluate simple Boolean functions at run time in C++. The functions are read from a file as strings. Is there any library available that I could use for this?
I looked into BuDDy but sounds like it doesn't parse strings.
Use boost library (lexical_cast.hpp)
bool a = boost::lexical_cast<bool>("true"); //true
bool b = boost::lexical_cast<bool>("0"); //false
Or go here num_get facet and stringstream conversion to boolean - fails with initialised boolean?