FastLED 3.9.15
Loading...
Searching...
No Matches

◆ upper_bound() [2/2]

template<typename Key, typename Value, typename Less = fl::less<Key>>
iterator fl::flat_map< Key, Value, Less >::upper_bound ( const Key & key)
inline

Definition at line 202 of file flat_map.h.

202 {
203 // Binary search: find first element where key < element
204 iterator first = mData.begin();
205 size_type count = mData.size();
206
207 while (count > 0) {
208 size_type step = count / 2;
209 iterator it = first + step;
210 if (!mLess(key, it->first)) {
211 first = it + 1;
212 count -= step + 1;
213 } else {
214 count = step;
215 }
216 }
217 return first;
218 }
typename vector_type::iterator iterator
Definition flat_map.h:45
size_type count(const Key &key) const FL_NOEXCEPT
Definition flat_map.h:152
fl::size size_type
Definition flat_map.h:36
vector_type mData
Definition flat_map.h:51

Referenced by fl::flat_map< int, FxPtr >::equal_range(), and fl::flat_map< int, FxPtr >::equal_range().

+ Here is the caller graph for this function: