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

◆ prev()

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

Definition at line 232 of file map.h.

233 {
235 if (it != end()) {
236 if (it != begin()) {
237 --it;
238 *prev_key = it->first;
239 return true;
240 } else if (allow_rollover && !empty()) {
241 *prev_key = data[data.size() - 1].first;
242 return true;
243 }
244 }
245 return false;
246 }
iterator end()
Definition map.h:36
VectorType data
Definition map.h:264
iterator begin()
Definition map.h:35
iterator find(const Key &key)
Definition map.h:40
constexpr bool empty() const
Definition map.h:251
VectorType::const_iterator const_iterator
Definition map.h:30