struct A
{
template<int>
void foo()
{}
};
int main()
{
A a;
a.foo<0>(); // ok
a.template foo<0>(); // also ok
}
Obviously, a.foo<0>();
is more concise, intuitive, and expressive than a.template foo<0>();
.
Why does C++ allow a.template foo<0>();
even though a.foo<0>();
is enough?