Allow implicit template properties for templates with more than one member

Frits van Bommel fvbommel at REMwOVExCAPSs.nl
Sat Dec 23 15:20:07 PST 2006


Jarrett Billingsley wrote:
> You can do this:
> 
> template Foo()
> {
>     const uint Foo = 5;
> }
> 
> ...
> 
> uint x = Foo!();
> 
> And it automatically looks up Foo!().Foo because it has one member named the 
> same as the template.
> 
> What I'm suggesting is that the "have one member" part be changed.  I've 
> written and seen a lot of template code that does stuff like this:

This has been proposed before, but (IIRC) with the added qualification 
that all other members should be private for it to work. Still hasn't 
happened though :(.



More information about the Digitalmars-d mailing list