FastLED
3.10.9
Loading...
Searching...
No Matches
◆
insert()
[1/3]
template<typename T>
iterator
fl::deque
< T >::insert
(
const_iterator
pos
,
const T &
value
)
inline
Definition at line
719
of file
deque.h
.
719
{
720
fl::size
idx
=
pos
.mIndex;
721
if
(
idx
==
mSize
) {
722
push_back
(
value
);
723
return
iterator
(
this
,
idx
);
724
}
725
// Push a copy of the current back to extend by one; chunk alloc
726
// is handled inside push_back. On allocation failure leave the
727
// contents unchanged and return end() (FastLED #4899).
728
fl::size
old_size
=
mSize
;
729
push_back
((*
this
)[
mSize
- 1]);
730
if
(
mSize
==
old_size
)
return
end
();
731
for
(
fl::size
i
=
mSize
- 1;
i
>
idx
+ 1; --
i
) {
732
(*this)[
i
- 1] =
fl::move
((*
this
)[
i
- 2]);
733
}
734
(*this)[
idx
] =
value
;
735
return
iterator
(
this
,
idx
);
736
}
fl::deque::iterator
Definition
deque.h:191
fl::deque::push_back
void push_back(const T &value) FL_NO_EXCEPT
Definition
deque.h:614
fl::deque::end
iterator end() FL_NO_EXCEPT
Definition
deque.h:515
fl::deque::mSize
fl::size mSize
Definition
deque.h:42
fl::deque
Definition
deque.h:29
fl::fl::adl_barrier::move
constexpr remove_reference< T >::type && move(T &&t) FL_NO_EXCEPT
Definition
s16x16x4.h:30
fl
deque
Generated on Mon Nov 2 2026 09:25:21 for FastLED by
1.13.2