MinGW is correct. It should not be possible to deduce TC
and TV
from QStringList
simply because QStringList
is a derived class of a template. There is a list of deduced contexts for function calls in the standard (C++11, §14.8.2.5/8) and TT<T>
is one of them, where TT
is a template template argument and T
is a template type argument. However, a class that derives from a template specialization is not itself a template specialization. Furthermore, while an lvalue of type QStringList
is implicitly convertible to QList<QString>
, template parameter deduction does not consider most types of implicit conversions.
Also, yes, you do need typename
. For an explanation of why, see Where and why do I have to put the "template" and "typename" keywords?
The Standard also says that an implementation is allowed to accept code that is ill-formed according to the Standard, as an extension. Visual C++ has a lot of extensions, so it accepts a lot of code that is not standard-compliant.