Covariance and Contravariance in C#3
Monday, March 9th, 2009A short introduction to Covariance and Contravariance in C# 3 preparing you to an article about that in C# 4.
So what is covariance ?
Covariance is basically using a method which returns something derived from the expected type.
An exemple ? It’s safe to have a method returning a cat when you expect it to return an animal.
(more…)