I'm looking for a way to parse a string for any valid C++ code, and then run it somehow. In particular, math functions like sin()
or cos()
.
The basic method of parsing every single character doesn't extend to expressions with multiple math functions.
Is there a way to parse and evaluate code from within a std::string?