Noah Roberts wrote:
Ian Collins wrote: William.Zhang wrote:
Cant be compiled by mingw (but can by borland c++ 5.5) .
Cant gcc support this ?
In my opinion, it shouldn't be compiling an unused template...
Yeah, that's a pretty serious violation of the standard.
Instantiating it would be a violation. Compiling it is mandatory. This
is the reason
we talk about two-phase name lookup for templates, in both phases name
lookup
happens. 'typename' is needed here (as others have shown) because it
tells the
compiler in phase 1 (compilation) what the results of phase 2
(instantiation) will be.
HTH,
Michiel Salters