This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
How do I control the order of constuctors
- To: help-gcc at gnu dot org
- Subject: How do I control the order of constuctors
- From: "John bebbington" <John dot Bebbington at t-online dot de>
- Date: Fri, 31 Dec 1999 15:19:57 +0100
- Newsgroups: gnu.gcc.help
- Organization: T-Online
- Xref: wodc7nx0 gnu.gcc.help:2321
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"
?