Gloabal object initalisation on MAC-OSX 10.3.3
Gloabal object initalisation on MAC-OSX 10.3.3
- Subject: Gloabal object initalisation on MAC-OSX 10.3.3
- From: Gaurav Kumar <email@hidden>
- Date: 08 Feb 2006 10:53:44 +0530
- Organization:
Steve,
The problem was with translation unit.My global variable was not
initialized because of dependency factor. Actually the order of
initialization was a problem.
I have solved the problem by using Singleton object with following code
snippet
class A{
public:
A(){
}
fun(){
}
};
A& initfun()
{
static A a;
return a;
}
In call to class A functions use this statement:
initfun().fun();
This will solve the order of initialization of global variables.
Gaurav
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden