std::pair<iterator,iterator> equal_range( const Key& key ); (1) (C++11 起) std::pair<const_iterator,const_iterator> equal_range( const Key& key ) const; (2) (C++11 起) template< class K > std::pair<iterator,iterator> equal_range( const K& x ); (3) (C++20 起) templat...
std::pair<const_iterator, const_iterator>equal_range(constK&x)const; (4)(since C++20) 1,2)Returns a range containing all elements with keykeyin the container. The range is defined by two iterators, the first pointing to the first element of the wanted range and the second pointing past...
std::unordered_multimap::equal_range std::unordered_multimap::erase std::unordered_multimap::extract std::unordered_multimap::find std::unordered_multimap::get_allocator std::unordered_multimap::hash_function std::unordered_multimap::insert std::unordered_multimap::key_eq std::unordered_multimap::...
正如@PeteBecker 指出的,您想要的电话是equal_range. 具体来说,是成员函数,而不是自由函数。 (未经测试的代码) auto p = myumm.equal_range("apple"); for (auto it = p.first; it != p.second; ++it) std::cout << " " << it->first << ":" << it->second; Run Code Online (Sandbox...
unordered_multimap::equal_range Bucket interface unordered_multimap::begin(size_type)unordered_multimap::cbegin(size_type) unordered_multimap::end(size_type)unordered_multimap::cend(size_type) unordered_multimap::bucket_count unordered_multimap::max_bucket_count unordered_multimap::bucket_size unordered_...
不要求此容器的迭代顺序稳定(故例如std::equal不能用于比较二个std::unordered_multimap),除了关键比较等价(以key_eq()为比较器比较相等)的每组元素在迭代顺序中组成相接的子范围,它亦可用equal_range()访问。 std::unordered_multimap满足容器(Container)、具分配器容器(AllocatorAwareContainer)、无序关联容器(Unorde...
不要求此容器的遍历顺序稳定(因此std::equal不能用于比较两个std::unordered_multimap),但键比较等价(以key_eq()为比较器比较相等)的每组元素在迭代顺序中均组成连续的子范围,也可以用equal_range()访问它们。 std::unordered_multimap满足容器(Container)、知分配器容器(AllocatorAwareContainer)和无序关联容器(Unorde...
Elements with equivalent keys are grouped together in the same bucketand in such a way that an iterator (see equal_range) can iterate through all of them. Iterators in the container are at least forward iterators. Notice that this container is not defined in its own header, but shares heade...
不要求此容器的迭代顺序稳定(故例如std::equal不能用于比较二个std::unordered_multimap),除了关键比较等价(以key_eq()为比较器比较相等)的每组元素在迭代顺序中组成相接的子范围,它亦可用equal_range()访问。 std::unordered_multimap满足容器(Container)、知分配器容器(AllocatorAwareContainer)、无序关联容器(Unorde...
不要求此容器的迭代顺序稳定(故例如std::equal不能用于比较二个std::unordered_multimap),除了关键比较等价(以key_eq()为比较器比较相等)的每组元素在迭代顺序中组成相接的子范围,它亦可用equal_range()访问。 std::unordered_multimap满足容器 (Container)、知分配器容器 (AllocatorAwareContainer)、无序关联容器 (...