D
Dilip
This is just an academic question but is there any particular reason
why this does not work?
template<typename T>
class Foo
{
public:
Foo(T x) : myvar_(x) { }
private:
T myvar_;
};
int main()
{
Foo xx(2); // why cannot the compiler deduce T as int?
return 0;
}
why this does not work?
template<typename T>
class Foo
{
public:
Foo(T x) : myvar_(x) { }
private:
T myvar_;
};
int main()
{
Foo xx(2); // why cannot the compiler deduce T as int?
return 0;
}