枚举元素限制 [英] enum element limit
本文介绍了枚举元素限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
C ++中允许的最大数量允许枚举
元素
Is there a maximum number of allowable enum
elements in C++?
(问题来自于我的答案上一个定义的问题)
(Question arose from answer to my previous question on defines)
推荐答案
没有任何指定的最大值或最小值,这取决于您的实现。但是请注意,附件B规定:
There isn't any specified maximum or minimum, it depends on your implementation. However, note that Annex B states:
- 在单个枚举中枚举常量[4096]。
— Enumeration constants in a single enumeration [4096].
作为推荐。但这绝对是一个建议,而不是一个要求。
As a recommendation. But this is strictly a recommendation, not a requirement.
这篇关于枚举元素限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文