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

◆ 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 209 of file map.h.

209 {
211 if (it != end()) {
212 if (it != begin()) {
213 --it;
214 *prev_key = it->first;
215 return true;
216 } else if (allow_rollover && !empty()) {
217 *prev_key = data[data.size() - 1].first;
218 return true;
219 }
220 }
221 return false;
222 }
iterator end()
Definition map.h:44
VectorType data
Definition map.h:252
iterator begin()
Definition map.h:41
iterator find(const Key &key)
Definition map.h:54
constexpr bool empty() const
Definition map.h:230
VectorType::const_iterator const_iterator
Definition map.h:35