FastLED 3.9.15
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 466 of file flat_map.h.

466 {
467 auto it = find(key);
468 if (it != end()) {
469 ++it;
470 if (it != end()) {
471 *next_key = it->first;
472 return true;
473 } else if (allow_rollover && !empty()) {
474 *next_key = begin()->first;
475 return true;
476 }
477 }
478 return false;
479 }
iterator begin() FL_NOEXCEPT
Definition flat_map.h:83
iterator end() FL_NOEXCEPT
Definition flat_map.h:84
iterator find(const Key &key) FL_NOEXCEPT
Definition flat_map.h:136
bool empty() const FL_NOEXCEPT
Definition flat_map.h:97