More specific instantiations

Jonathan M Davis jmdavisProg at gmx.com
Mon Feb 13 21:15:06 PST 2012


On Monday, February 13, 2012 20:25:46 bearophile wrote:
> Time ago I have suggested the "static static" idea, an usage example:
[snip]

I would point out that two different instantiations of the same template have 
_nothing_ in common with one another. It's as if you instantiate a template 
with two different set of arguments, it's as if you copied and pasted the code 
and then adjusted it according to the arguments. As such, having a "static 
static" variable or function which is common to them makes no more sense than 
std.datetime.SysTime and std.container.RedBlackTree sharing a variable or 
function. They're completely separate. Thinking that two different 
instantiations of the same template are related is just going to cause you 
trouble.

- Jonathan M Davis


More information about the Digitalmars-d mailing list