나는 다음과 같은 코드가 있습니다C++ : 연산자에 대한 어떤 경기는 <시 부스트 :: unordered_map도 반복하려고 <string,int>
boost::unordered_map<std::string, int> map;
map["hello"]++;
map["world"]++;
for(boost::unordered_map<std::string, int>::iterator it = map.begin(); it < map.end(); it++){
cout << map[it->first];
}
을 내가하려고하면 다음과 같은 오류를 얻을 수 있지만, 아무 생각도 이유가없는 컴파일?
error: no match for ‘operator<’ in ‘it < map.boost::unordered::unordered_map<K, T, H, P, A>::end [with K = std::basic_string<char>, T = int, H = boost::hash<std::basic_string<char> >, P = std::equal_to<std::basic_string<char> >, A = std::allocator<std::pair<const std::basic_string<char>, int> >, boost::unordered::unordered_map<K, T, H, P, A>::iterator = boost::unordered::iterator_detail::iterator<boost::unordered::detail::ptr_node<std::pair<const std::basic_string<char>, int> >*, std::pair<const std::basic_string<char>, int> >]()
'it! = map.end()'를 사용하십시오. – sje397