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

◆ lower_bound() [1/2]

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

Definition at line 119 of file flat_set.h.

119 {
120 // Binary search: find first element where !(element < key)
121 iterator first = mData.begin();
122 size_type count = mData.size();
123
124 while (count > 0) {
125 size_type step = count / 2;
126 iterator it = first + step;
127 if (mLess(*it, key)) {
128 first = it + 1;
129 count -= step + 1;
130 } else {
131 count = step;
132 }
133 }
134 return first;
135 }
fl::size size_type
Definition flat_set.h:28
vector_type mData
Definition flat_set.h:44
size_type count(const Key &key) const
Definition flat_set.h:110
typename vector_type::iterator iterator
Definition flat_set.h:38

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

Referenced by equal_range(), equal_range(), find(), find(), insert(), and insert().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: