operator as template parameter

Viewed 6269

Is it possible?

template<operator Op> int Calc(int a, b)
{ return a Op b; }

int main()
{ cout << Calc<+>(5,3); }

If not, is way to achieve this without ifs and switches?

5 Answers
Related