FastLED 3.10.8
Loading...
Searching...
No Matches

◆ insert() [1/2]

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

Definition at line 125 of file map.h.

126 {
127 iterator it = find(key);
128 if (it != end()) {
129 if (result) {
130 *result = exists;
131 }
132 return {false, it};
133 }
134 if (data.size() < N) {
135 data.push_back(PairKV(key, value));
136 if (result) {
137 *result = inserted;
138 }
139 return {true, data.end() - 1};
140 }
141 if (result) {
143 }
144 return {false, end()};
145 }
iterator find(const Key &key) FL_NO_EXCEPT
Definition map.h:40
fl::pair< Key, Value > PairKV
Definition map.h:26
VectorType::iterator iterator
Definition map.h:29
VectorType data
Definition map.h:270
iterator end() FL_NO_EXCEPT
Definition map.h:36

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

Referenced by update(), and update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: