我刚刚看到一个不熟悉的语法,同时寻找 GROUPBY
返回类型:
I've just saw an unfamiliar syntax while looking for GroupBy
return type:
public interface IGrouping<out TKey, out TElement> : IEnumerable<TElement>
MSDN来源
我知道什么呢退出
平均的方法,而不是在一个泛型接口。
I know what does out
mean in methods, but not in a generics interface.
这是什么退出
是什么意思?
这是两个通用改性剂之一介绍了C#4.0(Visual Studio 2010中)。
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.
请参阅出来(一般修改)和的在MSDN上(一般修改)。