Tuple vs ValueTuple mutability

35 views Asked by At

Why is Tuple immutable, and ValueTuple mutable?

ValueTuple<string, string> valTup = new ValueTuple<string, string>("a", "b");
valTup.Item1 = "c";  // OK

Tuple<string, string> tup = new Tuple<string, string>("a", "b");
tup.Item1 = "c";  // Doesn't compile
0

There are 0 answers