Quote Originally Posted by joebar View Post
So what is wrong here?
You don't need to specify the static keyword before the function definition, only before the declaration in the header file.
Apart from the bug itself here, is that the right way to achieve what I want to achieve?
I don't know what you want to achieve. However, what you have here is nothing but a glorified global variable. There is little use for a class with only static members (unless the class is designed to be used as a template argument, e.g. in policy based design). Instead you can use a namespace to prevent polluting the global namespace. But then still, you are using a global variable, which is often a sign of bad design.