Suppose I have some functions which have the same parameters and datatype, and I want to push them into a std::vector and enumerate them. Is it possible to do this?
Pseudocode:
typedef int func(int, int);
int add(int a, int b)
{
return a + b;
}
int minus(int a, int b)
{
return a - b;
}
vector<func> operations = {add, minus};
for (auto operation : operations)
{
// do something
}