Is it possible to store delegates in a container class dynamically

You will never really be able to declare a delegate that can take anything. At some point you have to have a concrete signature that both the broadcaster and receiver agree on in order to pass information back and forth.

You still aren’t really describing the problem that you’re trying to solve with this container. You’ve add more details to your description of the solution you’re trying to make work.

But I’m going to go out on a limb and guess you’re trying to implement some sort of event system that senders and receivers can bind to without having to know who’s on the other end of that connection.
Here is a solution that I have recently published on my github. At the very least give the readme a look to see if it describes what you’re trying to do. The solution here is not to have delegates that can take anything, but delegates that the compiler can easily generate in a well defined way that is type safe and knowable from both side of the communication channel.

1 Like