Re: How to declare "abstract" delegates list?

2017-05-06 Thread RedCAT via Digitalmars-d-learn
On Saturday, 6 May 2017 at 06:07:01 UTC, bauss wrote: By theory that should work. It's untested, so you might need a few tweaks here and there. Thanks!

Re: How to declare "abstract" delegates list?

2017-05-05 Thread bauss via Digitalmars-d-learn
On Saturday, 6 May 2017 at 06:07:01 UTC, bauss wrote: On Friday, 5 May 2017 at 14:20:43 UTC, RedCAT wrote: [...] I would do something like this: [...] You could also do use alias this to use the delegate instead of the class encapsulating the delegate.

Re: How to declare "abstract" delegates list?

2017-05-05 Thread bauss via Digitalmars-d-learn
On Friday, 5 May 2017 at 14:20:43 UTC, RedCAT wrote: 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

How to declare "abstract" delegates list?

2017-05-05 Thread RedCAT via Digitalmars-d-learn
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, DerivedT