A Huge Bummer When Using alias this

Jack Stouffer via Digitalmars-d digitalmars-d at puremagic.com
Thu Mar 24 15:52:20 PDT 2016


On Thursday, 24 March 2016 at 22:31:01 UTC, Jerry wrote:
> Basicly you need to test if param is a Nullable and if it is 
> get the
> template param first param.
> The FirstTemplateParamMatches template is more psuedo code.
> Maybe there is a nicer way to get the first template param.

You just illustrated my point exactly. This doesn't scale, you 
can't create special rules for every type when you're writing a 
library. Nullable is aliased to the get function, which returns 
int in this case. YOU SHOULDN'T HAVE TO DO THIS.

This is the exact use case of alias this and it doesn't work.


More information about the Digitalmars-d mailing list