When exactly is constructor of static local object called?
- by Honza Bambas
Say we have a code like this:
Some class {
Some() { // the ctor code }
};
Some& globalFunction()
{
static Some gSome;
return gSome;
}
When exactly 'the ctor code' is executed? As for normal static variables before main() or at the moment we first call to 'globalFunction()'?
How is it on different platforms and different compilers (cl, gcc, ...) ?
Thanks
-hb-