Re: AliasSeq of T.tupleof for class and all base classes

2017-10-01 Thread bitwise via Digitalmars-d-learn
On Saturday, 30 September 2017 at 12:42:17 UTC, Steven Schveighoffer wrote: [...] https://issues.dlang.org/show_bug.cgi?id=17870

Re: AliasSeq of T.tupleof for class and all base classes

2017-09-30 Thread bitwise via Digitalmars-d-learn
On Saturday, 30 September 2017 at 12:42:17 UTC, Steven Schveighoffer wrote: I think the problem may be that derived classes' tupleof has some of the same variables as the base class? I agree it should work, but I think if it did work, it may not be what you want. You would see a lot of repea

Re: AliasSeq of T.tupleof for class and all base classes

2017-09-30 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/29/17 11:39 PM, bitwise wrote: As far as I can tell, this code should compile: class B   { int a; } class D1 : B  { int b; } class D2 : D1 { int c; } template TupleOf(Classes...) {     static if(Classes.length > 1)     alias TupleOf = AliasSeq!(Classes[0].tupleof, TupleOf!(Class

AliasSeq of T.tupleof for class and all base classes

2017-09-29 Thread bitwise via Digitalmars-d-learn
As far as I can tell, this code should compile: class B { int a; } class D1 : B { int b; } class D2 : D1 { int c; } template TupleOf(Classes...) { static if(Classes.length > 1) alias TupleOf = AliasSeq!(Classes[0].tupleof, TupleOf!(Classes[1..$])); else static if(Classes