July 15, 2016 How define such scheleton classes | ||||
---|---|---|---|---|
| ||||
abstract class AbstractObject(S) if (IsSomeString!S) { } class OtherObject(S, bool R) : AbstractObject!S { int x; void Foo(int a, int b) { x = a + b; static if (R) // error { // more codes ..... } } } class OtherObjects(S) : AbstractObject!S { OtherObject!(S, bool) a, b; // error a = new OtherObject!(S, true)(); b = new OtherObject!(S, false)(); } |
July 15, 2016 Re: How define such scheleton classes | ||||
---|---|---|---|---|
| ||||
Posted in reply to Learner | Use an intermediate class: abstract class OtherObject1(S) : AbstractObject!S { abstract void Foo(int a, int b); class OtherObject(S, bool R) : OtherObject1!S { int x; override void Foo(int a, int b) |
Copyright © 1999-2021 by the D Language Foundation