QuoteOriginally posted by: PolterQuoteOriginally posted by: Cuchulainn It compiles on VS2010 and that is bad.Huh... turns out we should've tried Clang, too:
http://llvm.org/demo/If I copy-paste the code from
http://ideone.com/A4uZSR (keeping the same line numbers -- s.t. "source.cc:27:42" in the following denotes line 27, column 42 of the source code), I obtain the compilation diagnostics as the ones attached.Clang stops complaining if we get rid of the shadowed names like this:
http://ideone.com/l97a4SNote, that these second (and third, etc.) "T"s wouldn't do anything anyway, so it's not a loss (if anything, we may want to put different names for documentation purposes):QuoteThe second template parameter is new. It is a template template parameter. It has the following elements: The keyword template, starting the template template parameter; The keyword template is followed (between pointed brackets) by a list of template parameters that must be specified for the template template parameter. These parameters may be given names, but names are usually omitted as those names cannot be used in subsequent template definitions. On the other hand, providing formal names may help the reader of the template to understand the kind of templates that must be specified with the template template parameter.See:
http://www.icce.rug.nl/documents/cplusp ... PTEMPPARBy using-different-names-for-self-doc-code I mean something like "ElementType" in the following:template <typename T, template <typename ElementType> class Cont>class Stack;Notice, how "T" (which is a bad/non-descriptive name, BTW) and "ElementType" are different names.See:
http://www.informit.com/articles/articl ... 78Bleeding edge.