更新时间:2022-04-03 00:42:10
可能是未定义的行为(在这种情况下,因为您正在访问未初始化的对象),因为 a
在 A :: _ b $之前被初始化c $ c>。
It's not possible, it's undefined behavior (in this case, because you're accessing an uninitialized object) because a
is initialized before A::_b
.
查找静态初始化顺序失败。您不会收到任何错误,因为在这种情况下,有99%的情况会发生,这很容易诊断。
Look up static initialization order fiasco. You don't get an error because 99% of the times this happens, it's not easily diagnosable.