There are no problems compiling this code:
struct A
{
template<typename T>
void f(int) {}
};
A a;
a.f<double>(42);
However, similar code with templated constructor does not compile:
struct A
{
template<typename T>
A(int) {}
};
A a<double>(42);
Gcc gives the following error in the last line: error: unexpected initializer before '<' token
Is there a way to make constructor example work?