开发者

Syntax of the type SortedDictionary<(Of <(<'TKey, TValue>)>)>..::..Enumerator

According to MSDN:

SortedDictionary<(Of <(<'TKey, TValue>)>)>..::开发者_开发问答..Enumerator

is the return type in .Net 4.0 of the SortedDictionary GetEnumerator method. What in the world does this syntax mean. Certainly I am familiar with typical generics e.g.

public class MyClass<A,B> where A : C

but I don't know how to parse much of this declaration. What is Of, what is the the ' before TKey for, are the parenthesis meant to improve readability or are they necessary and what is the ..::.. ?


The "Of" part is the VB way of doing generics. But this looks like a broken mixture of C#, VB, F# and C++.

The "Type" part of the docs is correct though - the return type of the method is

System.Collections.Generic.SortedDictionary<TKey, TValue>.Enumerator

I suspect it was just a failure in whatever generates that bit of documentation. I suggest you report it on Connect.


I don't know what the reason is for that syntax in the msdn, but this is only confined to the msdn. There isn't a new syntax for generics.


In C# that's mean:

SortedDictionary<TKey, TValue>.Enumerator

In VB.NET:

SortedDictionary(OfType TKey, OfType TValue).Enumerator
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜