// Foo.hpp
struct Foo
{
static int s1;
static int s2;
static int func()
{
return s2 * 3;
}
};
// Foo.cpp
int Foo::s1 = 6;
int Foo::s2 = s1 * 2;
...and then use it elswhere.
1. Is s1 guaranteed to be initialized first so i can init s2 safely?
2. Is s2 guaranteed to be initialized first so i can call func() safely?
3. Any possible problems?