C++静态成员变量map如何初始化赋值 classa {public: typedef std::map<int,int>urlMap;staticurlMap mp;staticurlMap CreateMap() { urlMap tmp_map= { {1,1},{2,2},{3,3} };returntmp_map; } }; a::urlMap a::mp=a::CreateMap();intmain() { std::map<int,int>::iterator it =a::m...
static urlMap CreateMap() { urlMap tmp_map = { {1, 1},{2, 2},{3, 3} }; return tmp_map; } }; a::urlMap a::mp = a::CreateMap(); int main() { std::map<int, int>::iterator it = a::mp.begin(); while (it != a::mp.end()) { cout << it->first << " "<...
C++静态成员变量map如何初始化赋值 C++静态成员变量map如何初始化赋值class a { public:typedef std::map<int, int> urlMap;static urlMap mp;static urlMap CreateMap() { urlMap tmp_map = { {1, 1},{2, 2},{3, 3} };return tmp_map;} };a::urlMap a::mp = a::CreateMap();int main(...