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

◆ insert() [2/2]

template<typename Key, typename Value, fl::size N>
pair< bool, iterator > fl::FixedMap< Key, Value, N >::insert ( Key && key,
Value && value,
InsertResult * result = nullptr )
inline

Definition at line 151 of file map.h.

152 {
153 iterator it = find(key);
154 if (it != end()) {
155 if (result) {
157 }
158 return {false, it};
159 }
160 if (data.size() < N) {
161 data.push_back(PairKV(fl::move(key), fl::move(value)));
162 if (result) {
164 }
165 return {true, data.end() - 1};
166 }
167 if (result) {
169 }
170 return {false, end()};
171 }
VectorType::iterator iterator
Definition map.h:29
iterator end()
Definition map.h:36
VectorType data
Definition map.h:264
fl::pair< Key, Value > PairKV
Definition map.h:26
iterator find(const Key &key)
Definition map.h:40