alias type reduction

anonymous anonymous at example.com
Thu Dec 13 02:10:20 PST 2012


On Thursday, 13 December 2012 at 10:03:34 UTC, anonymous wrote:
> On Thursday, 13 December 2012 at 09:29:46 UTC, js.mdnq wrote:
>> class _A(T, _NestLevel) { }
>> alias _A!(T, true) A!(T) // <- does not work but essentially 
>> what I want
>
> template A(T) {
>   alias _A!(T, true) A;
> }
>
>> (or even better)
>>
>> class A(T, _NestLevel) { }
>> alias A!(T, true) A!(T)
>
> class A(T, bool _NestLevel = true) {}

For completeness' sake, this works too:

class A(T, bool b) {}
template A(T) {
   alias A!(T, true) A;
}


More information about the Digitalmars-d-learn mailing list