3 ms·
Basically yes. Except, with the new tuple syntax support in C# it's using a value type internally instead of the old Tuple class (I'm pretty sure Tuple's going
by mathw 10y ago
Basically yes. Except, with the new tuple syntax support in C# it's using a value type internally instead of the old Tuple class (I'm pretty sure Tuple's going to be gaining a set of deconstructors to allow it to participate though). And the pure tuple path apparently doesn't use the deconstructors, there's something fancier going on under the hood which is presumably faster.
But yes you can write a deconstructor for anything you like so it can participate in deconstructing assignment. And yes it can have side effects. And that would be VERY BAD.