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

◆ insert()

template<typename T, typename Allocator = fl::allocator<T>>
bool fl::HeapVector< T, Allocator >::insert ( iterator pos,
const T & value )
inline

Definition at line 602 of file vector.h.

602 {
603 // TODO: Introduce mMaxSize (and move it from SortedVector to here)
604 // push back and swap into place.
605 size_t target_idx = pos - begin();
607 auto last = end() - 1;
608 for (size_t curr_idx = last - begin(); curr_idx > target_idx;
609 --curr_idx) {
610 auto first = begin() + curr_idx - 1;
611 auto second = begin() + curr_idx;
612 swap(first, second);
613 }
614 return true;
615 }
void swap(HeapVector< T > &other)
Definition vector.h:587
void push_back(const T &value)
Definition vector.h:493