.NET 4.0 types with added support for co- or contravariance

Just a plain list of types from the .NET 4.0 Base Class Library where Microsoft has added support for covariance (out) and contravariance (in).

in System

// Delegates
Action<in T1[..in T16]>
Func<out TResult>
Func<in T1[..in T16], out TResult>
Comparison<in T>
Converter<in TInput, out TOutput>
Predicate<in T> 

// Interfaces
IComparable<in T>
IObservable<out T>
IObserver<in T>

in System.Collections.Generic

IComparer<in T> 
IEnumerable<out T> 
IEnumerator<out T> 
IEqualityComparer<in T> 

in System.Linq

IGrouping<out TKey,out TElement> 
IOrderedQueryable<out T> 
IQueryable<out T>

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s