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

◆ upper_bound() [1/2]

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

Definition at line 220 of file flat_map.h.

220 {
221 // Binary search: find first element where key < element
222 const_iterator first = mData.begin();
223 size_type count = mData.size();
224
225 while (count > 0) {
226 size_type step = count / 2;
228 if (!mLess(key, it->first)) {
229 first = it + 1;
230 count -= step + 1;
231 } else {
232 count = step;
233 }
234 }
235 return first;
236 }
size_type count(const Key &key) const FL_NOEXCEPT
Definition flat_map.h:152
fl::size size_type
Definition flat_map.h:36
typename vector_type::const_iterator const_iterator
Definition flat_map.h:46
vector_type mData
Definition flat_map.h:51