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

Method insert

src/fl/stl/flat_map.h:251–263  ·  view source on GitHub ↗

Insertion

Source from the content-addressed store, hash-verified

249
250 // Insertion
251 fl::pair<iterator, bool> insert(const value_type& value) FL_NOEXCEPT {
252 auto it = lower_bound(value.first);
253 if (it != end() && !mLess(value.first, it->first) && !mLess(it->first, value.first)) {
254 return fl::pair<iterator, bool>(it, false); // Already exists
255 }
256 bool success = mData.insert(it, value);
257 if (success) {
258 // After insert, find the newly inserted element
259 it = find(value.first);
260 return fl::pair<iterator, bool>(it, true);
261 }
262 return fl::pair<iterator, bool>(end(), false);
263 }
264
265 fl::pair<iterator, bool> insert(value_type&& value) FL_NOEXCEPT {
266 auto key = value.first;

Callers 1

flat_mapClass · 0.45

Calls 4

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

Tested by

no test coverage detected