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

◆ at() [2/2]

template<typename Key, typename Value, typename Less = fl::less<Key>>
Value & fl::flat_map< Key, Value, Less >::at ( const Key & key)
inline

Definition at line 136 of file flat_map.h.

136 {
137 auto it = lower_bound(key);
138 if (it != end() && !mLess(key, it->first) && !mLess(it->first, key)) {
139 return it->second;
140 }
141 // Key not found - could throw, but FastLED style is to assert
142 FASTLED_ASSERT(false, "Key not found in flat_map");
143 return mData.front().second; // unreachable
144 }
iterator lower_bound(const Key &key) FL_NO_EXCEPT
Definition flat_map.h:208
iterator end() FL_NO_EXCEPT
Definition flat_map.h:86
vector_type mData
Definition flat_map.h:53