当应用于命名空间范围的类时,静态是什么意思?

What does static mean when applied to a class at namespace scope?

本文关键字:静态 是什么 意思 应用于 命名空间 范围      更新时间:2023-10-16

我知道static在命名空间作用域的意思是"内部链接"。现在考虑下面的代码:

static class Foo {} foo;

static适用于Foofoo还是两者都适用?

适用于类定义后声明的变量。

在c++中,没有static class这样的东西。只有static对象和static函数

class Foo {}表示foo变量的类型。static使foo为静态