diff options
Diffstat (limited to 'Runtime/Utilities/StaticInitiator.h')
-rw-r--r-- | Runtime/Utilities/StaticInitiator.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Runtime/Utilities/StaticInitiator.h b/Runtime/Utilities/StaticInitiator.h index bbcdbee..b7b41aa 100644 --- a/Runtime/Utilities/StaticInitiator.h +++ b/Runtime/Utilities/StaticInitiator.h @@ -1,5 +1,8 @@ #pragma once +//https://stackoverflow.com/questions/1005685/c-static-initialization-order +//https://stackoverflow.com/questions/211237/static-variables-initialisation-order + // 静态构造函数 #include "ThirdParty/StaticConstructor/include/StaticConstructor.h" @@ -21,7 +24,7 @@ public: #define InvokeStaticFunc(func)\ static StaticFuncInvoker staticInvokerOf_##func(func); -// 用来初始化当前cpp里的静态变量 +// 用来初始化当前cpp里的静态变量,需要注意static变量初始化顺序(Static Initialization Order) #define InitializeStaticVariables(lambda)\ static StaticFuncInvoker staticInvoker(lambda); |