multiple `alias this` suggestion

Carl Sturtivant via Digitalmars-d digitalmars-d at puremagic.com
Sat Apr 29 16:22:27 PDT 2017


On Friday, 21 April 2017 at 14:55:31 UTC, Steven Schveighoffer 
wrote:
> One thing we can do also is just use declaration order to 
> prioritize which alias this to use.

Presumably using declaration order as a means of prioritizing 
which name wins was rejected as a design possibility in the case 
of mixin templates which don't do this.

There is a strong parallel between name collisions between 
multiple mixin template instantions in the same scope, and 
muliple AliasThis declarations in the same scope: both bring an 
arbitrary collection of names and their concomitant collisions 
into that scope.

So presumably using declaration order as a means of prioritizing 
which name wins in the case of AliasThis would be rejected for 
the same reasons as for mixin templates.



More information about the Digitalmars-d mailing list