I want to call a function of a class from exprtk.
I want to register a function with this toolkit with symbol_table.add_function.
Therefore it is required to derive my class like this from ifunction provided with that toolkit:
template <typename T>
struct foo : public exprtk::ifunction<T>
foo() : exprtk::ifunction<T>(0)
// here I want to access data from a class which owns this struct
Is it possible to include this struct in a way, that a class can access it and the operator() of this struct can access data in the class?
One possibility would be to pass a pointer of that class to the constructor of the struct. Is there a better way?