equal_range (1) template<classForwardIt,classT=typenamestd::iterator_traits<ForwardIt>::value_type>constexprstd::pair<ForwardIt, ForwardIt>equal_range(ForwardIt first, ForwardIt last,constT&value){returnstd::equal_range(first, last, value,std::less{});} ...
std::pair<const_iterator, const_iterator>equal_range(constK&x)const; (4)(C++14 起) 返回容器中所有拥有给定键的元素的范围。范围以两个迭代器定义,一个指向首个不小于key的元素,另一个指向首个大于key的元素。首个迭代器可以换用lower_bound()获得,而第二迭代器可换用upper_bound()获得。
std::pair<iterator, iterator> equal_range( const Key& key ); (1) std::pair<const_iterator, const_iterator> equal_range( const Key& key ) const; (2) template< class K > std::pair<iterator, iterator> equal_range( const K& x ); (3) (C++14 起) template< class K > std::...
std::map<Key,T,Compare,Allocator>::equal_range From cppreference.com <cpp |container |map std::pair<iterator, iterator>equal_range(constKey&key); (1) std::pair<const_iterator, const_iterator>equal_range(constKey&key)const;
equalrangeSyntaxpairITERATORiteratorequalrangeconstKEYTYPEkeyequalrange函数返回两个迭代器——一个指向第一个键值为key的元素另一个指向最后一个键值为key的元素。erase语法voideraseiteratorposvoideraseiteratorstartiteratorendsizetypeeraseconstKEYTYPEkeyerase函数删除在pos位置的元素或者删除在start和end之间的元素或者...
equal_range returns range of elements matching a specific key (public member function) lower_bound returns an iterator to the first elementnot lessthan the given key (public member function) upper_bound returns an iterator to the first elementgreaterthan the given key ...
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::equal 不能用于比较两个 std::unordered_multiset),但关键比较等价(以 key_eq() 为比较器比较相等)的每组元素均组成迭代顺序中的连续子范围,也可以用 equal_range() 访问它。 std::unordered_multiset 满足容器 (Container) 、知分配器容器 (AllocatorAwareContainer) 和...
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...
at 带越界检查访问指定的元素 (公开成员函数) operator[] 访问或插入指定的元素 (公开成员函数) count 返回匹配特定键的元素数量 (公开成员函数) equal_range 返回匹配特定键的元素范围 (公开成员函数) 首页 社区专页 新闻动态 最近更改 随机页面 帮助 链入页面 相关更改 上传文件 特殊页面 打印版本 永久...