这个陈述在C标准7.1.6.11中的相关性是什么?

这个陈述在C标准7.1.6.11中的相关性是什么?,第1张

概述7.1.6.1/1包含以下声明(强调我的): There are two cv-qualifiers, const and volatile. If a cv-qualifier appears in a decl-specifier-seq, the init-declarator-list of the declaration shall not be empty. 以上粗体语句的相关性是什么 7.1.6.1/1包含以下声明(强调我的):

There are two cv-qualifIErs,const and volatile. If a cv-qualifIEr
appears in a decl-specifIEr-seq,the init-declarator-List of the
declaration shall not be empty.

以上粗体语句的相关性是什么?换句话说,是否可以在decl-specifIEr-seq中生成cv-unqualifIEd类型的示例,其中声明的init-declarator-List为空?

解决方法 当然,大多数类和枚举定义都使用它:
struct A { }; // valIDconst struct B { }; // invalID,const would have no meaningconst struct C { } c { }; // valID

没有别的. init-declarator-List仅用于简单声明,为此,标准(C 11)声明:

7 Declarations [dcl.dcl]

3 In a simple-declaration,the optional init-declarator-List can be omitted only when declaring a class (Clause 9) or enumeration (7.2),that is,when the decl-specifIEr-seq contains either a class-specifIEr,an elaborated-type-specifIEr with a class-key (9.1),or an enum-specifIEr.

总结

以上是内存溢出为你收集整理的这个陈述在C标准7.1.6.1/1中的相关性是什么?全部内容,希望文章能够帮你解决这个陈述在C标准7.1.6.1/1中的相关性是什么?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/1240409.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-06
下一篇 2022-06-06

发表评论

登录后才能评论

评论列表(0条)

保存