I have c++ std::map object like
std::map<std::string, int> data = {{"a",1},{"b",2}};
And I have a string expression consists of the keys in this map:
"(a%2)+2*((b-2)%2)"
All I want to do is to calculate the value of this expression, and the return type should be int
. Is there a way to do this? Maybe the boost
package could be helpful.