std::map<Key,T,Compare,Allocator>::lower_bound
来自cppreference.com
iterator lower_bound(const Key& key ); | (1) | |
const_iterator lower_bound(const Key& key )const; | (2) | |
template<class K > iterator lower_bound(const K& x ); | (3) | (C++14 起) |
template<class K > const_iterator lower_bound(const K& x )const; | (4) | (C++14 起) |
1,2) 返回指向首个不小于(即大于或等于)key 的元素的迭代器。
3,4) 返回指向首个比较不小于(即大于或等于)值 x 的元素的迭代器。此重载只有在限定标识 Compare::is_transparent 合法并指代类型时才会参与重载决议。它允许调用此函数时无需构造
Key
的实例。目录 |
[编辑]参数
key | - | 要与元素比较的键值 |
x | - | 能与 Key 比较的替用值 |
[编辑]返回值
指向首个不小于key 的元素的迭代器。若找不到这种元素,则返回尾后迭代器(见 end())。
[编辑]复杂度
与容器大小成对数。
注解
功能特性测试宏 | 值 | 标准 | 功能特性 |
---|---|---|---|
__cpp_lib_generic_associative_lookup | 201304L | (C++14) | 关联容器中的异质比较查找;重载 (3,4) |
[编辑]Example
本节未完成 原因:暂无示例 |
[编辑]参阅
返回匹配特定键的元素范围 (公开成员函数) | |
返回指向首个大于 给定键的元素的迭代器 (公开成员函数) |