Can C # 7 tuples destructure in parameter lists?

I am confused by C # 7 tuples and, frankly, the very light amounts of documentation around them.

For example, I know from examples that I can do this

var tup = (a: 1, b: 2);
(var a, var b) = tup;

      

But this is literally the only example I see. I know from experience in other languages ​​that it is much more common to want to destroy tuples in parameter lists.

so something like

test(tup);

      

...

int ((int a, int b)) => a + b;

      

But I can't understand the syntax and can't find any examples - is it possible at all?

+3
syntax c # destructuring tuples c # -7.0


source to share


No one has answered this question yet

See similar questions:

22
In C # 7 it is possible to deconstruct tuples as method arguments

or similar:

2006
What does ** (double star / asterisk) and * (star / asterisk) do for parameters?
1270
Why not inherit from List <T>?
963
What's the difference between lists and tuples?
962
How can I make a line break (line continuation) in Python?
843
Can someone explain __all__ in Python?
593
What are "named tuples" in Python?
518
How to sort (list / tuple) lists / tuples by element at a given index?
397
List versus tuple, when to use each?
321
Convert list to tuple in Python
246
Sort the list of tuples by the second element (integer value)



All Articles
Loading...
X
Show
Funny
Dev
Pics