Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

out parameters and contravariance

7 views
Skip to first unread message

Marcel Müller

unread,
Apr 16, 2013, 8:04:17 AM4/16/13
to
Why does
public delegate void ActionOut<out T>(out T arg1);
not work?

From my understanding arg1 is only passed from the callee to the
caller, so it should be safe, if the delegate is invoked with a base
class of T.


Marcel

bradbury9

unread,
Apr 16, 2013, 9:19:49 AM4/16/13
to
Maybe a bit dumb question but... It looks like 'too generic to work'. Should not the T derive from EventArg?

Something like:

public delegate void ActionOut<T>(T arg1) where T : EventArgs


0 new messages