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

Function insert

src/fl/stl/vector.h:294–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

292 }
293
294 bool insert(iterator pos, const T &value) FL_NOEXCEPT {
295 if (current_size >= N) {
296 return false;
297 }
298
299 // Construct a new element at end() position using placement new
300 new (end()) T();
301 ++current_size;
302
303 // Shift elements from [pos, end-1) to the right by one position
304 for (iterator p = end() - 1; p > pos; --p) {
305 *p = fl::move(*(p - 1));
306 }
307
308 // Assign the new value to the insertion position
309 *pos = value;
310 return true;
311 }
312
313 // Move version of insert
314 bool insert(iterator pos, T &&value) FL_NOEXCEPT {

Callers 15

emplaceMethod · 0.70
insertMethod · 0.70
emplaceMethod · 0.70
emplace_hintMethod · 0.70
MultiSetTreeMethod · 0.70
insertMethod · 0.70
updateMethod · 0.70
MultiMapTreeMethod · 0.70
insertMethod · 0.70
emplaceMethod · 0.70
insertMethod · 0.70

Calls 7

push_backFunction · 0.85
endFunction · 0.70
beginFunction · 0.70
swapFunction · 0.70
lower_boundFunction · 0.70
sizeMethod · 0.45
insertMethod · 0.45

Tested by 4

test_pmr_clear_emptiesFunction · 0.40
test_pmr_remove_oneFunction · 0.40