I'm having a syntax issue with initializer_lists, I just want to know if this is an issue with my compiler, my knowledge of c++, or whether it is not supported by the standard. I'm trying this with g++4.4.5 on Debian Squeeze.
The problem is that the commented line won't compile, it bails with
You can only specify template arguments after the name of a template. They make no sense after the name of a concrete object.
X::calculate() is a function template, so var.calculate<5>() is a template instantiation
X::operator() is a function template, so var.operator()<5>() is a template instantiation
var is an object, so var<5> is var less then 5 greater than ...
Moreover, X itself is not a template, so X<5> is not possible either. There simply isn't a way to provide template arguments to the function call operator here without writing it out explicitly, X().operator()<5>