This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

How do I control the order of constuctors


Hello,
Can anyone tell me how to control the order of calling class constuctors
which occur before the main().

I have several c++ classes that create object intances in their .cc files.
Example:

file a.h:

class a { }
external a;

file a.cc
......
 a the_a;

file main.cc
#include "a.h"
#include "b.h"
main () {}

question: how can I ensure that object "the_a" is contructed before "the_b"
?





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]