alias type reduction

js.mdnq js_adddot+mdng at gmail.com
Thu Dec 13 01:29:45 PST 2012


This has probably been asked a million times.

given A(T1, T2)
alias A!(T1, int) A!(T1);

specifically,

http://dpaste.dzfl.pl/64025e0a

in that code, if I want to add a parameter to A, then at line 65 
I want the alias to represent that.

I am trying to hide away the "true"(as it is always true and used 
for other things the user doesn't care about).

class _A(T, _NestLevel) { }
alias _A!(T, true) A!(T) // <- does not work but essentially what 
I want


(or even better)

class A(T, _NestLevel) { }
alias A!(T, true) A!(T)

this way, I can instantiate A's without having to specify true 
everywhere. (which would liter the code with "true" tokens for no 
good reason)







More information about the Digitalmars-d-learn mailing list