I am completely new in C# covariant and contravariant concept. I have been following YouTube tutorials and MSDN docs, but they are still confusing. It will be very kind of you if please explain why cannot I return T from a contravariant delegate with "in T" and why cannot I take T as parameter for a covariant delegate with "out T". And, when should I use covariant and when should I contravariant?
Thank you very much of answering.
Edit 1: I wanted to do something like this:
public delegate T ContravariantDelegate<in T>();
public delegate void CovariantDelegate<out T>(T b);