liam_herron <li*********@hotmail.comwrote in news:e4d15259-3bb6-416b-
8f***************@m36g2000hse.googlegroups.com:
This compiled on Windows but not on Linux?
I assume that when you say Windows you mean VC and Linux you mean gcc.
OS's in general don't compile much of anything. But anyway, VC does use a
strictly conforming 2 phase lookup model which in some cases (like this) is
good and others is not.
>
Why do I need to specify the "typename"?
You need the typename to tell the compiler that you expect that syntax to
result in a type. Without it, it can't tell until you instantiate the
method with some type. Remember that templates can be specialized and each
specializaton can look pretty radically different from any other. Of
course, in this case, since it is a std container, the compiler could know,
but in general it doesn't.
>
Ahh, template syntax is always so straightforward :)
Ahhh, I love a good joke. I think the problem with templates is that the
went from a simple mechanism for writing generics to a programming language
all its own and the syntax has suffered. But that's just my opinion.
joe