std::flat_map<Key,T,Compare,KeyContainer,MappedContainer>::lower_bound
來自 cppreference.com
iterator lower_bound( const Key& key ); |
(1) | (C++23 起) |
const_iterator lower_bound( const Key& key ) const; |
(2) | (C++23 起) |
template< class K > iterator lower_bound( const K& x ); |
(3) | (C++23 起) |
template< class K > const_iterator lower_bound( const K& x ) const; |
(4) | (C++23 起) |
1,2) 返回一個迭代器,指向第一個“不小於”(即大於或等於)key的元素。
3,4) 返回一個迭代器,指向第一個“不小於”(即大於或等於)值 x 的元素。此過載僅當限定 ID Compare::is_transparent 有效且表示一個型別時才參與過載決議。它允許在不構造
Key
例項的情況下呼叫此函式。目錄 |
[編輯] 引數
key | - | 用於比較元素的鍵值 |
x | - | 可與Key 比較的替代值 |
[編輯] 返回值
迭代器指向第一個不小於 key 的元素。如果未找到此類元素,則返回一個 past-the-end 迭代器(參見 end())。
[編輯] 複雜度
容器大小的對數級別。
[編輯] 示例
本節不完整 原因:無示例 |
[編輯] 另請參見
返回與特定鍵匹配的元素範圍 (public member function) | |
返回指向第一個大於給定鍵的元素的迭代器 (public member function) |