I’m currently authoring some WinRT custom controls in c++, and my compiler/intellisense is telling me that static constructors are not allowed.
I need to set up some static data, and I could use a private bool instance flag and on the first instantiation of my class I can create the static data etc.. (effectively achieving the same thing).
However, maybe I’ve missed something, as this seems a bit long-winded.
What is the canonical alternative approach to static construction in WinRT/c++
Thanks
You declare the static members inside the class, but you have to define them outside: