FastLED 3.9.15
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages

◆ prev()

template<typename Key, typename Value, size_t N>
bool fl::FixedMap< Key, Value, N >::prev ( const Key & key,
Key * prev_key,
bool allow_rollover = false ) const
inline

Definition at line 196 of file map.h.

197 {
199 if (it != end()) {
200 if (it != begin()) {
201 --it;
202 *prev_key = it->first;
203 return true;
204 } else if (allow_rollover && !empty()) {
205 *prev_key = data[data.size() - 1].first;
206 return true;
207 }
208 }
209 return false;
210 }
iterator end()
Definition map.h:36
VectorType data
Definition map.h:228
iterator begin()
Definition map.h:35
iterator find(const Key &key)
Definition map.h:40
constexpr bool empty() const
Definition map.h:215
VectorType::const_iterator const_iterator
Definition map.h:30