FastLED 3.10.8
Loading...
Searching...
No Matches

◆ insert() [3/3]

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

Definition at line 721 of file deque.h.

721 {
722 fl::size idx = pos.mIndex;
723 if (idx == mSize) {
725 return iterator(this, idx);
726 }
727 // Move-extend at the back so move-only T works. The moved-from
728 // slot at old logical mSize-1 is overwritten by the shift loop.
729 push_back(fl::move((*this)[mSize - 1]));
730 for (fl::size i = mSize - 1; i > idx + 1; --i) {
731 (*this)[i - 1] = fl::move((*this)[i - 2]);
732 }
733 (*this)[idx] = fl::move(value);
734 return iterator(this, idx);
735 }
void push_back(const T &value) FL_NO_EXCEPT
Definition deque.h:602
fl::size mSize
Definition deque.h:42
constexpr remove_reference< T >::type && move(T &&t) FL_NO_EXCEPT
Definition s16x16x4.h:30