I have a base function
int base(const int i, const double &x)
In this function, I consider i to be a "parameter" (which can take predefined values from 0 to N-1), while x I consider to be the actual "argument" (which can take any arbitrary value).
What I need is to create an array of function pointers int (*pointers[N])(const double &x). Each member of the array corresponds to a different value for the parameter i and thus each call pointers[n](x) should be equivalent to a call base(n, x).
Is there a way to achieve this functionality?
I have been trying to educate myself about functors (is this a way to go?) and recently also looked into std::bind but my understanding is that it only works with C++11 (which I currently cannot use).
Any advice or code snippet would be really helpful. Thanks!