Skip to content

Commit f3bbb16

Browse files
authored
Apply suggestions from code review
1 parent 9c0a038 commit f3bbb16

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/design_gamedev.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ private:
7777
Game() { ... }
7878

7979
public:
80-
static Game instance; // 非定义声明,因为 Game 在此处为不完整类型
80+
// inline static Game instance; // 虽然很爽,但不能这样写,因为 Game 在他的 }; 结束前都是不完整类型
81+
static Game instance; // 非定义声明,就好比全局变量的 extern Game instance 一样,不需要是完整类型
8182
};
8283

8384
inline Game Game::instance; // 如果定义在头文件中,需要 inline!

0 commit comments

Comments
 (0)