How to declare "abstract" delegates list?

RedCAT via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri May 5 07:20:43 PDT 2017


Hello!

Is it possible to create a list of slightly different delegates?

For example, there is a class hierarchy:

class Base;
class DerivedOne : Base;
class DerivedTwo : Base;

And there are several delegates:

void delegate(int, Base);
void delegate(int, DerivedOne);
void delegate(int, DerivedTwo);

It's easy to see that the only difference in the declarations of 
these delegates is the type of the second parameter, this is the 
class inherited from Base.

How can I create a list or an array where I can add these 
delegates?


More information about the Digitalmars-d-learn mailing list