§3.5/ 4
An unnamed namespace or a namespace declared directly or indirectly@H_419_7@ within an unnamed namespace has internal linkage. All other namespaces@H_419_7@ have external linkage. A name having namespace scope that has not been@H_419_7@ given internal linkage above has the same linkage as the enclosing@H_419_7@ namespace if it is the name of
a variable; or a function; or a named class (Clause 9),or an unnamed class defined in a typedef declaration in which the class has the typedef name for linkage@H_419_7@ purposes (7.1.3); or a named enumeration (7.2),or an unnamed enumeration defined in a typedef declaration in which the enumeration has the typedef name for@H_419_7@ linkage purposes (7.1.3); or an enumerator belonging to an enumeration with linkage; or a template.
关于§7.3.1.1/ 1的注释[94]:
解决方法 您正在查看标准中的缺陷.Although entitIEs in an unnamed namespace might have external linkage,@H_419_7@ they are effectively qualifIEd by a name unique to their translation@H_419_7@ unit and therefore can never be seen from any other translation unit.
在2010年11月(CWG issue 1113)的C 11标准化过程中,使未命名的命名空间成员具有内部链接的更改发生得相当晚.因此,标准中的许多地方需要改变,但事实并非如此.其中一个是你引用的脚注.
CWG issue 1603,目前处于“就绪”状态(阅读:该决议很可能在下次委员会会议上通过),将修复此问题以及与未命名的命名空间成员提供内部链接相关的许多其他问题.
总结以上是内存溢出为你收集整理的c – 在具有外部链接的匿名命名空间中声明的实体示例全部内容,希望文章能够帮你解决c – 在具有外部链接的匿名命名空间中声明的实体示例所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)