0

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.

Ari
  • 7,251
  • 11
  • 40
  • 70
  • I suppose all these http://en.wikipedia.org/wiki/Binary_decision_diagram#External_links do their job, but it is up to you to load the data – ShinTakezou May 13 '12 at 18:07

1 Answers1

0

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?

Community
  • 1
  • 1
wsx
  • 1
  • 1