C++ static members, multiple Objects
问题 I've got some trouble with static members and methods in C++. This is the Class header: class Decoration { public: //Static Methods static void reloadList(); //Static Members static std::unordered_map<int, Decoration> decorationMapID; }; And in .cpp: void Decoration::reloadList() { sqlTable result = db->exec("SELECT id, name, description FROM decorations"); for(sqlRow r: result) { Decoration::decorationMapID.insert(std::pair<int,Decoration>(atoi(r[0].c_str()), Decoration(r[1], r[2], atoi(r[0]