Does anyone know of a library that allows you to do something like this?
std::transform(vecA.begin(), vecA.end(),
vecB.begin(),
vecOutput.begin(),
// run-time specified expression
magic_functor<float>("exp(a/(b+3))")
);
Where magic_functor is the library-provided functor and a and b are iterated through vecA and vecB.
I could come up with something myself (and would have a lot of fun doing so), but it's probably better to avoid reinventing the wheel (also my boss would kill me). Have spent some time searching the web, but can't really find anything that fits the bill.
It needs to be flexible and fast, so a functor approach that only parses the string once (e.g. creates an execution stack internally on construction) would be ideal, but am open to other solutions.
Several options (need some work and won't work “out of the box”):
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With