Will a future version of .NET support tuples in C#?

前端 未结 12 1737
别那么骄傲
别那么骄傲 2020-11-28 23:54

.Net 3.5 doesn\'t support tuples. Too bad, But not sure whether the future version of .net will support tuples or not?

12条回答
  •  野性不改
    2020-11-29 00:17

    In my opinion, the anonymous types feature is not a tuple, but a very similar construct. The output of some LINQ Queries are collections of anonymous types, which behave like tuples.

    Here is a statement, which creates a typed tuple :-) on the fly:

    var p1 = new {a = "A", b = 3};
    

    see: http://www.developer.com/net/csharp/article.php/3589916

提交回复
热议问题