let's suppose that there are N functions that take different inputs and that return different values:
int h(int);
string g(int);
double f(string);
Of course it is possible to write something like:
f(g(h(4)))
Suppose now that I want to store these functions f,g,h into a kind of container like:
Container c;
c.add(h);
c.add(g);
c.add(f);
Given an input for the first function (an int in the case of f) I would like these function being executed in a sequential way, with each of them taking as input the output of the previous one.
Do you think is it possible in C++? possibly without using dynamic_cast and using C++11