Whilst looking through some code I have found the following syntax:
template<class X>
class A
{
public:
template <typename Z>
void func()
{
Z as;
as++;
}
};
void f()
{
A<int> obj;
obj.template func<int>();
}
Is there any reason or good practice for obj.template func<int>()
? I would usually just go for obj.func<int>()
Is this some new syntax in c++11/14/17/20?
Thank you!