std::multiset<Key,Compare,Allocator>::lower_bound
来自 cppreference.cn
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) | (since C++14) |
template< class K > const_iterator lower_bound( const K& x ) const; |
(4) | (since C++14) |
1,2) 返回指向首个不小于(即大于或等于)key元素的迭代器。
3,4) 返回指向首个与值 x 比较为不小于(即大于或等于)的元素的迭代器。此重载仅在限定标识符 Compare::is_transparent 有效并表示类型时才参与重载决议。它允许在不构造
Key
实例的情况下调用此函数。内容 |
[edit] 参数
key | - | 用于比较元素的键值 |
x | - | 可以与 Key 比较的替代值 |
[edit] 返回值
指向首个不小于 key 的元素的迭代器。如果未找到此类元素,则返回 past-the-end 迭代器(参见 end())。
[edit] 复杂度
对容器大小呈对数。
注解
特性测试 宏 | 值 | Std | 特性 |
---|---|---|---|
__cpp_lib_generic_associative_lookup |
201304L |
(C++14) | 在关联容器中的异构比较查找;重载 (3,4) |
[edit] 示例
本节尚不完整 原因:没有示例 |
[edit] 参见
返回与特定键匹配的元素范围 (公共成员函数) | |
返回指向首个大于给定键的元素的迭代器 (公共成员函数) |