Sort of, but only because int
is a special case. For example, suppose you write in Object.cpp
:
Object o = {};
int Object::number = 5;
Then the object o
has static storage duration, just like Object::number
does. It is nominally created before number
and will be destroyed afterwards, but since they're both POD this destruction actually has no effect.
If number
and o
had non-trivial destructors, though, then number
would be destroyed before o
. The fact that number
is a static member of the class of o
doesn't give it any special treatment as far as order of destruction is concerned.
If o
is off in another source file, then order of construction is unspecified, and order of destruction is reverse order of construction (again, that's if they had non-trivial destructors -- int
is a special case since it doesn't).