Top "Covariance" questions

Covariance, contravariance and invariance describe how the existing type inheritance hierarchy changes when subjected to some transformation (such as usage within generics).

still confused about covariance and contravariance & in/out

ok i read a bit on this topic on stackoverflow, watched this & this, but still a bit confused about …

c# covariance
When is C++ covariance the best solution?

This question was asked here a few hours ago and made me realise that I have never actually used covariant …

c++ covariance return-type
T must be contravariantly valid

What is wrong with this? interface IRepository<out T> where T : IBusinessEntity { IQueryable<T> GetAll(); void …

c# .net generics covariance contravariance
overriding virtual function return type differs and is not covariant

Ah, SO came back just in time. I am getting a strange error: 'B::blah': overriding virtual function return type …

c++ covariance virtual-functions return-type object-slicing
java generics covariance

I am having trouble understanding the following article: http://www.ibm.com/developerworks/java/library/j-jtp01255.html Under, Generics are …

java generics alias covariance
Simple examples of co and contravariance

Could someone provide me simple C# examples of convariance, contravariance, invariance and contra-invariance (if such thing exists). All samples I've …

c# .net covariance contravariance invariants
How to calculate the Standard error from a Variance-covariance matrix?

I am calculating a variance-covariance matrix and I see two different ways of calculating the standard errors: sqrt(diagonal values/…

statistics covariance variance standard-error covariance-matrix
Is there a generic Task.WaitAll?

I start a few parallel tasks, like this: var tasks = Enumerable.Range(1, 500) .Select(i => Task.Factory.StartNew<int&…

c# generics task-parallel-library covariance
Faster way to cast a Func<T, T2> to Func<T, object>?

Is there a faster way to cast Fun<TEntity, TId> to Func<TEntity, object> public static …

c# reflection lambda covariance
Invalid variance: The type parameter 'T' must be contravariantly valid on 'UserQuery.IItem<T>.ItemList'. 'T' is covariant

Why the property get the error while the method can be compiled? public interface IFoo {} public interface IBar<out …

c# covariance