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

◆ emplace()

template<typename T>
template<typename... Args>
iterator fl::deque< T >::emplace ( const_iterator pos,
Args &&... args )
inline

Definition at line 783 of file deque.h.

783 {
784 fl::size idx = pos.mIndex;
785 if (idx == mSize) {
787 return iterator(this, idx);
788 }
789 // Move-extend at the back so move-only T works. The moved-from
790 // slot at old logical mSize-1 is overwritten by the shift loop.
791 push_back(fl::move((*this)[mSize - 1]));
792 for (fl::size i = mSize - 1; i > idx + 1; --i) {
793 (*this)[i - 1] = fl::move((*this)[i - 2]);
794 }
795 (*this)[idx] = T(fl::forward<Args>(args)...);
796 return iterator(this, idx);
797 }
void push_back(const T &value) FL_NO_EXCEPT
Definition deque.h:602
fl::size mSize
Definition deque.h:42
T & emplace_back(Args &&... args) FL_NO_EXCEPT
Definition deque.h:800
constexpr remove_reference< T >::type && move(T &&t) FL_NO_EXCEPT
Definition s16x16x4.h:30