代码:
std::map<int,int> bad blocks;
bad_blocks.clear();
bad_blocks.insert(std::map::value_type(1,50);
报错:C2955 “std::map” use of class template requires template argument list
这个怎么解决?谢谢!
std::map<int,int> bad blocks;
bad_blocks.clear();
bad_blocks.insert(std::map::value_type(1,50);
报错:C2955 “std::map” use of class template requires template argument list
这个怎么解决?谢谢!
解决方案
40
std::map<int,int> bad_blocks; bad_blocks.clear(); bad_blocks.insert(std::map<int,int>::value_type(1,50));
40
或
std::map<int,int> bad_blocks; bad_blocks.clear(); bad_blocks.insert(std::make_pair(1,50));