double add(double a, double b)
{
return a + b;
}
double subtract(double a, double b)
{
return a - b;
}
double multiply(double a, double b)
{
return a * b;
}
double divide(double a, double b)
{
return a / b;
}
//typedef decltype(sum)* add;
using func = decltype(add)*;
int main()
{
vector<func> funv = { add,subtract,multiply,divide };
double a = 1, b = 2;
for (int i = 0; i < 4; i++)
{
cout << (funv[i])(a, b) << endl;
}
return 0;
}