Re: Is this a bug ?

2016-07-11 Thread Chang Long via Digitalmars-d-learn
On Tuesday, 12 July 2016 at 04:38:42 UTC, Chang Long wrote: test.d = template newType(size_t N){ class NewType { enum Type = N ; } } just find it should be this: template newType(size_t N){ class NewType {

Is this a bug ?

2016-07-11 Thread Chang Long via Digitalmars-d-learn
test.d = template newType(size_t N){ class NewType { enum Type = N ; } } class A{} alias Type = newType!1 ; N New(N)(){ return new N(); } void main(){ auto a = New!A; auto n = New!Type; }