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

◆ lower_bound() [2/2]

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

Definition at line 166 of file flat_map.h.

166 {
167 // Binary search: find first element where !(element < key)
168 iterator first = mData.begin();
169 size_type count = mData.size();
170
171 while (count > 0) {
172 size_type step = count / 2;
173 iterator it = first + step;
174 if (mLess(it->first, key)) {
175 first = it + 1;
176 count -= step + 1;
177 } else {
178 count = step;
179 }
180 }
181 return first;
182 }
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 >::at(), fl::flat_map< int, FxPtr >::at(), fl::flat_map< int, FxPtr >::equal_range(), fl::flat_map< int, FxPtr >::equal_range(), fl::flat_map< int, FxPtr >::find(), fl::flat_map< int, FxPtr >::find(), fl::flat_map< int, FxPtr >::insert(), fl::flat_map< int, FxPtr >::insert(), fl::flat_map< int, FxPtr >::insert(), fl::flat_map< int, FxPtr >::insert(), and fl::flat_map< int, FxPtr >::operator[]().

+ Here is the caller graph for this function: