We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9c0a038 commit f3bbb16Copy full SHA for f3bbb16
docs/design_gamedev.md
@@ -77,7 +77,8 @@ private:
77
Game() { ... }
78
79
public:
80
- static Game instance; // 非定义声明,因为 Game 在此处为不完整类型
+ // inline static Game instance; // 虽然很爽,但不能这样写,因为 Game 在他的 }; 结束前都是不完整类型
81
+ static Game instance; // 非定义声明,就好比全局变量的 extern Game instance 一样,不需要是完整类型
82
};
83
84
inline Game Game::instance; // 如果定义在头文件中,需要 inline!
0 commit comments