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

◆ lower_bound() [2/2]

template<typename Key, typename Less = fl::less<Key>>
const_iterator fl::flat_set< Key, Less >::lower_bound ( const Key & key) const
inline

Definition at line 137 of file flat_set.h.

137 {
138 // Binary search: find first element where !(element < key)
139 const_iterator first = mData.begin();
140 size_type count = mData.size();
141
142 while (count > 0) {
143 size_type step = count / 2;
145 if (mLess(*it, key)) {
146 first = it + 1;
147 count -= step + 1;
148 } else {
149 count = step;
150 }
151 }
152 return first;
153 }
fl::size size_type
Definition flat_set.h:28
vector_type mData
Definition flat_set.h:44
typename vector_type::const_iterator const_iterator
Definition flat_set.h:39
size_type count(const Key &key) const
Definition flat_set.h:110

References count(), mData, mLess, and fl::step().

+ Here is the call graph for this function: