On 2011-05-10 18:06, Jose Armando Garcia wrote: > Thanks. I should have read > http://www.digitalmars.com/d/2.0/template.html more carefully. > > "Multiple instantiations of a TemplateDeclaration with the same > TemplateArgumentList, before implicit conversions, all will refer to > the same instantiation." > > The default values which are evaluated at the call site are part of > the TemplateArgumentList.
Yes, default arguments are evaluated at the call site, not where the code is declared. I believe that C++ has the opposite behavior, so it's not uncommon that people miss that. It's _very_ useful though - particularly when dealing with __FILE__ and __LINE__. - Jonathan M Davis