I have the following code:
//MyClass.h
class MyClass {
public:
typedef std::map<std::string, int> OpMap;
static OpMap opMap_;
// (more methods)
};
//MyClass.cpp
//Init opMap_
MyClass::opMap_["x"] = 1; //compilation error
How can I (statically) initialize opMap_
?