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

◆ update()

template<typename Key, typename Value, size_t N>
bool fl::FixedMap< Key, Value, N >::update ( const Key & key,
const Value & value,
bool insert_if_missing = true )
inline

Definition at line 165 of file map.h.

165 {
166 iterator it = find(key);
167 if (it != end()) {
168 it->second = value;
169 return true;
170 } else if (insert_if_missing) {
171 return insert(key, value).first;
172 }
173 return false;
174 }
Pair< bool, iterator > insert(const Key &key, const Value &value, InsertResult *result=nullptr)
Definition map.h:141
VectorType::iterator iterator
Definition map.h:34
iterator end()
Definition map.h:44
iterator find(const Key &key)
Definition map.h:54