I have a pretty heavy object in my code which is static. I was wondering if you move the initialization of the member variables outside of the constructor, would they execute every time or just once?
struct test
{
int a;
int b;
};
void foo() {
static test T;
T.a=123;
T.b=341;
}
int main()
{
foo();
foo();
foo();
}
Will
T.a=123;
T.b=341;
be executed every time foo() is called?