在 .Net 4.0 中可以使用元组的实际示例? [英] Practical example where Tuple can be used in .Net 4.0?

查看:22
本文介绍了在 .Net 4.0 中可以使用元组的实际示例?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看到 .Net 4 中引入的元组,但我无法想象它可以用在哪里.我们总是可以创建自定义类或结构.

I have seen the Tuple introduced in .Net 4 but I am not able to imagine where it can be used. We can always make a Custom class or Struct.

推荐答案

这就是重点 - 不是总是制作自定义类或结构更方便.它是一种类似于 ActionFunc 的改进......你可以自己制作这些类型,但它们存在于框架中很方便.

That's the point - it is more convenient not to make a custom class or struct all the time. It is an improvement like Action or Func... you can make this types yourself, but it's convenient that they exist in the framework.

这篇关于在 .Net 4.0 中可以使用元组的实际示例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆