In this question, the asker has the following function:
template
bool nextPermutation(ITER start, ITER end)
{
return nextPermutation
Doesn't MSVC implement the late-parsing scheme? In such a scheme, the compiler isn't dependent on typename. It just stores all the token in between the template definition's braces, and when the template is instantiated, it parses those tokens. Since it then knows what is and what is not a type, it will work without typename.
But if the compiler doesn't diagnose the missing typename when you instantiate the template, then it's non-conforming.
Or is it actually possible to deduce that iterator_category is either a type or a function because it's followed by a pair of parenthesis ()?
All that matters is whether the name is dependent and qualified. Whether or not the template could deduce itself that the name is always a type doesn't matter. It might matter for the quality of error messages for missing typenames though.
FWIW, no it's not possible to deduce anything about iterator_category on a language level.