Skip to content

Instantly share code, notes, and snippets.

@vannell
Created June 17, 2014 12:15
Show Gist options
  • Save vannell/58ef3d4d2bde4aa6e584 to your computer and use it in GitHub Desktop.
Save vannell/58ef3d4d2bde4aa6e584 to your computer and use it in GitHub Desktop.
C++ Static initialization
class A {
static T a;
static T initStaticA() {
T t;
//do some stuff on t
return t;
}
};
T A::a = initStaticA();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment