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

◆ update() [2/2]

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

Definition at line 186 of file map.h.

187 {
188 iterator it = find(key);
189 if (it != end()) {
190 it->second = fl::move(value);
191 return true;
192 } else if (insert_if_missing) {
193 return insert(key, fl::move(value)).first;
194 }
195 return false;
196 }
VectorType::iterator iterator
Definition map.h:29
iterator end()
Definition map.h:36
pair< bool, iterator > insert(const Key &key, const Value &value, InsertResult *result=nullptr)
Definition map.h:125
iterator find(const Key &key)
Definition map.h:40
constexpr remove_reference< T >::type && move(T &&t) noexcept
Definition move.h:27