I am using C++11.
Usually, we define static members as follows:
my_static.hpp:
class MyClass
{
public:
static double MyStaticVar;
};
my_static.cpp:
double::MyClass MyStaticVar = 100.001;
Say I have a static library where all files are header-only *.hpp
files.
Suppose I don't want to use any *.cpp
files. I only want to use *.hpp
header files.
Then how do you define a static member variable?
Aucun commentaire:
Enregistrer un commentaire