inline static member variable
问题 struct sa { struct sb { int a = 123;}; inline static sb b; }; The above code generates an error: main.cpp:25:20: error: default member initializer for ‘sa::sb::a’ required before the end of its enclosing class inline static sb b; ^ main.cpp:24:21: note: defined here struct sb { int a = 123;}; ^~~~~~ Removing the inline keyword or the default member initializer works. But just from the output, I don't understand why this usage is wrong. 回答1: I think this code is correct and should be accepted;