T
Tobias Müller
template <typename R, typename P1, typename P2, R (*f)(P1,P2)>
class MyClass
{
R myMethod(P1 param1, P2 param2);
};
This works, however I must always specify all the template arguments R, P1,
and P2, even if those could always be deduced from the 4th argument f:
int fun(double a, int b);
MyClass<int, double, int, &fun> myObject;
int c = myObject.myMethod(1.0, 2);
But I want some different template such that I can write:
MyClass<&fun> myObject;
All the information about R, P1, and P2 is already implicitly there.
Tobi
class MyClass
{
R myMethod(P1 param1, P2 param2);
};
This works, however I must always specify all the template arguments R, P1,
and P2, even if those could always be deduced from the 4th argument f:
int fun(double a, int b);
MyClass<int, double, int, &fun> myObject;
int c = myObject.myMethod(1.0, 2);
But I want some different template such that I can write:
MyClass<&fun> myObject;
All the information about R, P1, and P2 is already implicitly there.
Tobi