std::multimap<Key,T,Compare,Allocator>::upper_bound
来自cppreference.com
iterator upper_bound( const Key& key ); |
(1) | (C++26 起为 constexpr) |
const_iterator upper_bound( const Key& key ) const; |
(2) | (C++26 起为 constexpr) |
template< class K > iterator upper_bound( const K& x ); |
(3) | (C++14 起) (C++26 起为 constexpr) |
template< class K > const_iterator upper_bound( const K& x ) const; |
(4) | (C++14 起) (C++26 起为 constexpr) |
1,2) 返回指向首个大于 key 的元素的迭代器。
3,4) 返回指向首个大于 x 的元素的迭代器。
参数
| key | - | 与元素比较的键值 |
| x | - | 能与 Key 比较的替用值
|
返回值
指向首个大于给定键的元素的迭代器,或在不存在这种元素时返回 end()。
复杂度
与容器大小成对数。
注解
| 功能特性测试宏 | 值 | 标准 | 功能特性 |
|---|---|---|---|
__cpp_lib_generic_associative_lookup |
201304L |
(C++14) | 关联容器中的异质比较查找;重载 (3,4) |
示例
| 本节未完成 原因:暂无示例 |
参阅
| 返回匹配特定键的元素范围 (公开成员函数) | |
| 返回指向首个不小于 给定键的元素的迭代器 (公开成员函数) |