I have always thought that function template argument deduction can work only for pure function like below and not for classes.
template <class T1,class T2, class T3>
T foo(T2 a, T3 b)
{
T o;
//..do something
return o;
}
Today Just by chance I put such function within a class and it did work like below.
class MyClass
{
public:
template <class T1,class T2, class T3>
T foo(T2 a, T3 b)
{
T o;
//..do something
return o;
}
}
I am using g++ 4.4 in Linux. Should this have failed or I misunderstood?