我可以构建一个长长的清单< INT>这样,该指数是多长? [英] can I construct a long list<int> such that the index is long?

查看:93
本文介绍了我可以构建一个长长的清单< INT>这样,该指数是多长?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前的指数列表< INT> 可以是的Int32,我可以去的Int64

currently the index a List<int> can take is Int32, can I go for Int64?

因此,我可以使用像MYLIST [万亿。

So i can use something like mylist[1000000000000].

推荐答案

没有你不能。

,如果它被允许这不会是有用的。在CLR对在2GB的对象的最大尺寸的限制。因此,它甚至不是可以构造一个数组,其中一个指数将是有益的。

This would not be useful if it was allowed. The CLR has a limit on the maximum size of an object at 2GB. Hence it's not even possible to construct an array where a long index would be useful.

这篇关于我可以构建一个长长的清单&LT; INT&GT;这样,该指数是多长?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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