Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
$3.5 - “此外,如果类的名称具有外部链接,则成员函数、静态数据成员、类或类范围的枚举具有外部链接。”
关于这意味着什么的任何输入'if the name of the class has external linkage'?
'if the name of the class has external linkage'
与命名空间范围中定义的类和使用静态说明符定义的命名空间范围类(具有内部链接???)相比,“本地类”(可能没有任何链接)的提示是什么?
本地类(但不一定是嵌套类)没有链接。不能使用静态说明符定义类。所以这等效地可以表述如下:
$3.5 - “此外,成员函数、静态数据成员、类或类范围的枚举具有外部链接,除非包含类是本地类或者是本地类中的直接或间接嵌套类。”