I've just saw an unfamiliar syntax while looking for GroupBy
return type:
public interface IGrouping<out TKey, out TElement> : IEnumerable<TElement>
I know what does out
mean in methods, but not in a generics interface.
What does out
mean in a generic type?
It is one of the two generic modifiers introduces in C# 4.0 (Visual Studio 2010).
It signifies that the generic parameter it is declared on is covariant.
The in
modifier signifies the generic parameter it is declared on is contravariant.
See out (Generic Modifier) and in (Generic Modifier) on MSDN.