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

◆ erase() [2/2]

template<typename T>
iterator fl::deque< T >::erase ( const_iterator pos)
inline

Definition at line 642 of file deque.h.

642 {
643 if (pos == end()) return end();
644
645 fl::size index = pos.mIndex;
646
647 // Destroy element at pos
649 mData[erase_idx].~T();
650
651 // Shift elements from pos+1 to end one position to the left
652 for (fl::size i = index; i < mSize - 1; ++i) {
655 new (&mData[to_idx]) T(fl::move(mData[from_idx]));
656 mData[from_idx].~T();
657 }
658
659 --mSize;
660 return iterator(this, index);
661 }
fl::size mSize
Definition deque.h:18
fl::size get_index(fl::size logical_index) const
Definition deque.h:55
T * mData
Definition deque.h:16
iterator end()
Definition deque.h:381