June 21, 2005 Delegates + Polymorphism | ||||
---|---|---|---|---|
| ||||
I think that this should be allowed: class A {} class B:A {} struct C { void foo(A a) {} } void main() { C c; void delegate(B b) dl = &c.foo; } That is to say, that I think void delegate(A a) should be implicitly castable to void delegate(B b) since all B's are also A's. I can't think of any reasons for this not to be. John Demme |
Copyright © 1999-2021 by the D Language Foundation