We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0e07608 commit e5d0518Copy full SHA for e5d0518
docs/cpp_tricks.md
@@ -343,17 +343,17 @@ vector<string> spilt(string str) {
343
344
```cpp
345
struct Class {
346
- static Class instance;
+ static int member;
347
};
348
```
349
350
-会报错 `undefined reference to 'Class::instance'`。这是说的你需要找个 .cpp 文件,写出 `Class Class::instance` 才能消除该错误。
+会报错 `undefined reference to 'Class::member'`。这是说的你需要找个 .cpp 文件,写出 `int Class::member` 才能消除该错误。
351
352
C++17 中,只需加个 `inline` 就能解决!
353
354
355
356
- inline static Class instance;
+ inline static int member;
357
358
359
0 commit comments