Array of derived class objects?

Andrej Mitrovic andrej.mitrovich at gmail.com
Tue Mar 6 14:35:47 PST 2012


You can use a cast as a workaround:
A[] objs = [cast(A)new B, new C ];

This bug has been around for a while, the first time I've seen it
mentioned was in the second code snippet in this blog post:
http://klickverbot.at/blog/2010/11/announcing-d-support-in-swig/


More information about the Digitalmars-d-learn mailing list