struct A
{
A() : n(1)
{}
int n;
};
struct B
{
B() : n(2)
{}
int n;
};
thread_local A a;
B b;
int main()
{
return a.n;
}
a
is defined before b
.
My question:
Does the C++ standard guarantee B::B()
is called before A::A()
is called?