【发布时间】:2013-07-28 11:40:15
【问题描述】:
我正在尝试编译 C++ 源文件,但在尝试编译时遇到以下错误。
错误:
错误:“模板类 std::map”在没有模板参数的情况下使用
我在具有mp.find(someString) 的行中得到错误。
map<string, int *> mp;
sub = "xyz";
if(mp.find(sub) != map::end) {
doSomething();
}
执行if 语句时出现错误。
我该如何解决这个问题?
【问题讨论】:
-
此参考可能会有所帮助:en.cppreference.com/w/cpp/container/map/find
-
template class std::map used without template parameters的哪一部分需要澄清?
标签: c++ c++11 visual-c++ dictionary find