我想编译一个C++源文件,但是当我尝试编译它时遇到了下面的错误。编译C++代码时出现编译错误
错误:
error: ‘template class std::map’ used without template parameters
我得到了它具有mp.find(someString)
行的错误。
map<string, int *> mp;
sub = "xyz";
if(mp.find(sub) != map::end) {
doSomething();
}
执行if
语句时出现错误。
我该如何解决这个问题?的map::end
更新
这个参考可能会有帮助:http://en.cppreference.com/w/cpp/container/map/find –
哪一部分的'模板类的std ::地图使用没有模板参数需要澄清? –