How can I check if an element of a multimap exists?
With this code:
typedef std::multimap<std::string, std::string> TagVal;
TagVal tv;
//... add values to tv ...
TagVal::const_iterator it = tv.find("abc");
if(it == TagVal::end()) // <--- ERROR
cerr << "Error";
我收到以下编译时间错误:
error: cannot call member function std::multimap<...>::iterator std::multimap<...>::end() ... without object.
平台:Linux,海合会4.5.1