c# multi assignment

后端 未结 7 1785
温柔的废话
温柔的废话 2020-12-16 13:54
int a, b, n;
...
(a, b) = (2, 3);
// \'a\' is now 2 and \'b\' is now 3

This sort of thing would be really helpfull in C#. In this example \'a\' and

7条回答
  •  [愿得一人]
    2020-12-16 14:13

    We have considered supporting a syntactic sugar for tuples but it did not make the bar for C# 4.0. It is unlikely to make the bar for C# 5.0; the C# 5.0 team is pretty busy with getting async/await working right. We will consider it for hypothetical future versions of the language.

    If you have a really solid usage case that is compelling, that would help us prioritize the feature.

提交回复
热议问题