当应用于命名空间范围的类时,静态是什么意思?
What does static mean when applied to a class at namespace scope?
我知道static
在命名空间作用域的意思是"内部链接"。现在考虑下面的代码:
static class Foo {} foo;
static
适用于Foo
、foo
还是两者都适用?
适用于类定义后声明的变量。
在c++中,没有static class
这样的东西。只有static
对象和static
函数
class Foo {}
表示foo
变量的类型。static
使foo
为静态
相关文章:
- C++从另一个类访问公共静态向量的正确方法是什么
- Clang 8 带有静态 constexpr 和数组的链接器错误 - 错误是什么以及如何解决它?
- 静态自动 constexpr t = { "red" , "black" , "green" } 是什么类型;派生到?
- 静态初始化的反义词是什么?
- 在这种情况下,我们可以使用静态而不是朋友吗,还有其他解决方案是什么
- 使用 openssl 构建静态二进制文件的正确方法是什么?
- 创建静态哨兵节点的正确方法是什么
- 使用静态类成员而不是私有字段之间的速度差异是什么?
- 类静态变量初始化的规则是什么?
- C 中静态声明的结构的范围是什么?
- 在静态函数中返回对象而不是构建对象的优点是什么?
- 在Linux上构建具有链接时代码生成功能的静态库的正确方法是什么
- 使用静态映射在C++中缓存数据的推荐方法是什么
- 如果我创建一个修改值的迭代器,静态成员"reference"应该是什么类型?
- 一个类本身有一个静态成员的功能是什么?
- 在java/c++/c/actionscript-3应用程序中使用静态变量的最佳方法是什么?
- 是什么原因阻止我将VS2010中的静态库正确链接到我的.dll
- 当应用于命名空间范围的类时,静态是什么意思?
- c++中的私有静态是什么意思?
- C 和 C++ 中的"常量静态"是什么意思?