我有以下无序多图:
std::tr1::unordered_multimap<unsigned int, unsigned int > duplicates;
我尝试使用
std::pair<std::tr1::unordered_multimap<unsigned int, unsigned int>,std::tr1::unordered_multimap<unsigned int, unsigned int> > range = duplicates.equal_range(id);
然后使用 for 循环获得多个结果:
for (std::tr1::unordered_multimap<unsigned int, unsigned int>::iterator it=range.first; it!=range.second; ++it)
但我收到以下错误:
ref_impl/core.cpp:306:84: error: conversion from 'std::tr1::unordered_multimap<unsigned int, unsigned int>' to non-scalar type 'std::tr1::_Hashtable<unsigned int, std::pair<const unsigned int, unsigned int>, std::allocator<std::pair<const unsigned int, unsigned int> >, std::_Select1st<std::pair<const unsigned int, unsigned int> >, std::equal_to<unsigned int>, std::tr1::hash<unsigned int>, std::tr1::__detail::_Mod_range_hashing, std::tr1::__detail::_Default_ranged_hash, std::tr1::__detail::_Prime_rehash_policy, false, false, false>::iterator {aka std::tr1::__detail::_Hashtable_iterator<std::pair<const unsigned int, unsigned int>, false, false>}' requested
ref_impl/core.cpp:306:101: error: no match for 'operator!=' in 'it != range.std::pair<std::tr1::unordered_multimap<unsigned int, unsigned int>, std::tr1::unordered_multimap<unsigned int, unsigned int> >::second'
有什么建议么?