| 200 | } |
| 201 | |
| 202 | iterator upper_bound(const Key& key) FL_NOEXCEPT { |
| 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 | } |
| 219 | |
| 220 | const_iterator upper_bound(const Key& key) const FL_NOEXCEPT { |
| 221 | // Binary search: find first element where key < element |