You could do something like this:
Code:
double function1(double x)
{
return 3*x;
}
bool condition1(double x)
{
return x > 2;
}
double function2(double x)
{
return -x;
}
bool condition2(double x)
{
return x < 2;
}
typedef double (*SingleFunction)(double);
typedef bool (*Condition)(double);
typedef std::list< std::pair<SingleFunction , Condition> > Function;
And then when the function is called traverse the list for a matching condition.
It's very easy to do in Omicron:
Code:
function f(x) = 3x if x > 2
function f(x) = -x if x < 2