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

◆ insert() [2/2]

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

Definition at line 147 of file map.h.

148 {
149 iterator it = find(key);
150 if (it != end()) {
151 if (result) {
152 *result = exists;
153 }
154 return {false, it};
155 }
156 if (data.size() < N) {
157 data.push_back(PairKV(fl::move(key), fl::move(value)));
158 if (result) {
159 *result = inserted;
160 }
161 return {true, data.end() - 1};
162 }
163 if (result) {
165 }
166 return {false, end()};
167 }
fl::pair< Key, Value > PairKV
Definition map.h:26
VectorType::iterator iterator
Definition map.h:29
VectorType data
Definition map.h:270
iterator end()
Definition map.h:36
iterator find(const Key &key)
Definition map.h:40

References at_capacity, data, end(), exists, find(), inserted, fl::fl::move(), and fl::type_rank< T >::value.

+ Here is the call graph for this function: