c# - Tuple vs ValueTuple mutability
问题描述
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
解决方案
推荐阅读
- database - 如何修复 Cassandra 服务器中的“活动:活动(退出)”问题?
- reactjs - How to float a View over all Views in a screen
- python - Python IPv6 正则表达式模式识别
- java - Convert Double to Key (Priority queue)
- r - 无法使用公共 IP 访问管道工 API
- node.js - Nodejs读取大txt文件并转换编码
- ajax - 我如何知道网站使用的 API?
- javascript - 在 chart.js 的标签和数据集表中编码
- javascript - 在 for 循环中使用绑定事件
- excel - 通过单击excel中的宏按钮打开VBA窗口