Angus Leeming <[EMAIL PROTECTED]> writes:
| > Angus> The question still remains however: why are the last few lines
| > Angus> of language.C needed?
| >
| > Angus> static LangInit langinit;
| > Angus> bool LangInit::init = false;
| >
| > It is a bool telling whether the initialization of languages has been
| > done already, I guess.
|
| Sorry, I didn't make myself clear. What I meant was, why does this static
| variable exist at all? It has scope only within the file and does nothing
| here other than initialise class static variable LangInit::init to true.
| Thereafter, this variable is reset to false. Why can't we get rid of
| "static LangInit langinit;" ?
It make the LangInit::LangInit constructor be run before main is
started by the runtime environment.
The errors you are seeing your be a problem with ordering of
initializatoin of static global variables.
Feel free to rewrite this is a lazy singleton class.
Lgb