8

Is there a possibility to access the elements of a tuple directly in a deconstructed way in the argument list of a lambda expression like in the following snippet?

Func<(int A, int B), int> f = ((a, b)) => a + b;

What works fine is decomposing the tuple inside the body:

Func<(int, int), int> f = i => i.Item1 + i.Item2;
David
  • 2,426
  • 3
  • 24
  • 36

0 Answers0