C
Christopher
I am really getting tired of working through defects that relate to
initialization order problems, so I've taken to documentating
everything I can find on init order, problems and solutions.
I've read over the C++ FAQ section 10 and got a few things, but I
still have quite a few questions.
When do static data members get initialized in relation to the class
itself and global variables?
Note - I read how to wrap them in methods, but am still interested.
When you have a executable process that loads libs or dlls, what is
the order of intialization for global variables in each?
Does the executable have its globals before the libs or dlls? or
vica versa?
When are const members initialized? such as class A{ private: const
int x;}
At what point are static member functions useable?
I read that you can force deinitialization order by controlling the
intialization order. Such that if I have a static instance of class A
that makes use of a static instance of class B in A's destructor, that
I can create a static instance of B in the constructor of A to force
the static instance B to be destroyed last. Is that correct?
initialization order problems, so I've taken to documentating
everything I can find on init order, problems and solutions.
I've read over the C++ FAQ section 10 and got a few things, but I
still have quite a few questions.
When do static data members get initialized in relation to the class
itself and global variables?
Note - I read how to wrap them in methods, but am still interested.
When you have a executable process that loads libs or dlls, what is
the order of intialization for global variables in each?
Does the executable have its globals before the libs or dlls? or
vica versa?
When are const members initialized? such as class A{ private: const
int x;}
At what point are static member functions useable?
I read that you can force deinitialization order by controlling the
intialization order. Such that if I have a static instance of class A
that makes use of a static instance of class B in A's destructor, that
I can create a static instance of B in the constructor of A to force
the static instance B to be destroyed last. Is that correct?