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

116 {
117 auto it = lower_bound(key);
118 if (it != end() && !mLess(key, it->first) && !mLess(it->first, key)) {
119 return it->second;
120 }
121 // Key not found - could throw, but FastLED style is to assert
122 FASTLED_ASSERT(false, "Key not found in flat_map");
123 return mData.front().second; // unreachable
124 }
iterator lower_bound(const Key &key) FL_NOEXCEPT
Definition flat_map.h:166
iterator end() FL_NOEXCEPT
Definition flat_map.h:84
vector_type mData
Definition flat_map.h:51