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

◆ insert() [2/3]

template<typename T>
iterator fl::deque< T >::insert ( const_iterator pos,
fl::size count,
const T & value )
inline

Definition at line 619 of file deque.h.

619 {
620 fl::size index = pos.mIndex;
622
623 // Shift elements from pos to end 'count' positions to the right
624 for (fl::size i = mSize + count - 1; i >= index + count; --i) {
627 new (&mData[to_idx]) T(fl::move(mData[from_idx]));
628 mData[from_idx].~T();
629 }
630
631 // Insert new elements
632 for (fl::size i = 0; i < count; ++i) {
634 new (&mData[insert_idx]) T(value);
635 }
636 mSize += count;
637
638 return iterator(this, index);
639 }
fl::size mSize
Definition deque.h:18
void ensure_capacity(fl::size min_capacity)
Definition deque.h:24
fl::size get_index(fl::size logical_index) const
Definition deque.h:55
T * mData
Definition deque.h:16