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

151 {
152 iterator it = find(key);
153 if (it != end()) {
154 it->second = value;
155 return true;
156 } else if (insert_if_missing) {
157 return insert(key, value).first;
158 }
159 return false;
160 }
Pair< bool, iterator > insert(const Key &key, const Value &value, InsertResult *result=nullptr)
Definition map.h:125
VectorType::iterator iterator
Definition map.h:29
iterator end()
Definition map.h:36
iterator find(const Key &key)
Definition map.h:40