MCPcopy Create free account
hub / github.com/FastLED/FastLED / insert

Method insert

src/fl/stl/flat_set.h:204–216  ·  view source on GitHub ↗

Insertion

Source from the content-addressed store, hash-verified

202
203 // Insertion
204 fl::pair<iterator, bool> insert(const value_type& value) {
205 auto it = lower_bound(value);
206 if (it != end() && !mLess(value, *it) && !mLess(*it, value)) {
207 return fl::pair<iterator, bool>(it, false); // Already exists
208 }
209 bool success = mData.insert(it, value);
210 if (success) {
211 // After insert, find the newly inserted element
212 it = find(value);
213 return fl::pair<iterator, bool>(it, true);
214 }
215 return fl::pair<iterator, bool>(end(), false);
216 }
217
218 fl::pair<iterator, bool> insert(value_type&& value) {
219 auto key = value;

Callers

nothing calls this directly

Calls 4

lower_boundFunction · 0.70
endFunction · 0.70
findFunction · 0.70
insertFunction · 0.70

Tested by

no test coverage detected