FastLED 3.10.8
Loading...
Searching...
No Matches

◆ next()

template<typename Key, typename Value, typename Less = fl::less<Key>>
bool fl::flat_map< Key, Value, Less >::next ( const Key & key,
Key * next_key,
bool allow_rollover = false ) const
inline

Definition at line 452 of file flat_map.h.

452 {
453 auto it = find(key);
454 if (it != end()) {
455 ++it;
456 if (it != end()) {
457 *next_key = it->first;
458 return true;
459 } else if (allow_rollover && !empty()) {
460 *next_key = begin()->first;
461 return true;
462 }
463 }
464 return false;
465 }
iterator find(const Key &key) FL_NO_EXCEPT
Definition flat_map.h:156
iterator begin() FL_NO_EXCEPT
Definition flat_map.h:85
bool empty() const FL_NO_EXCEPT
Definition flat_map.h:99
iterator end() FL_NO_EXCEPT
Definition flat_map.h:86