FastLED
3.9.15
Loading...
Searching...
No Matches
◆
insert()
[2/2]
template<typename T, fl::size N>
bool
fl::FixedVector
< T, N >::insert
(
iterator
pos
,
T &&
value
)
inline
Definition at line
278
of file
vector.h
.
278
{
279
if
(
current_size
<
N
) {
280
// shift all element from pos to end to the right
281
for
(
iterator
p
=
end
();
p
!=
pos
; --
p
) {
282
T
temp
=
fl::move
(*(
p
- 1));
283
(
p
)->~
T
();
// Destroy the current element
284
// Clear the memory
285
void
*
vp
=
static_cast<
void
*
>
(
p
);
286
fl::memfill
(
vp
, 0,
sizeof
(
T
));
287
new
(
p
)
T
(
fl::move
(
temp
));
// Use move constructor
288
}
289
++
current_size
;
290
// now insert the new value
291
new
(
pos
)
T
(
fl::move
(
value
));
292
return
true
;
293
}
294
return
false
;
295
}
fl::FixedVector::iterator
T * iterator
Definition
vector.h:87
fl::FixedVector::current_size
fl::size current_size
Definition
vector.h:341
fl::FixedVector::end
iterator end()
Definition
vector.h:324
fl::FixedVector
Definition
vector.h:78
fl::move
constexpr remove_reference< T >::type && move(T &&t) noexcept
Definition
move.h:27
fl::memfill
void * memfill(void *ptr, int value, fl::size num)
Definition
memfill.h:11
fl
FixedVector
Generated on Fri Aug 22 2025 20:59:36 for FastLED by
1.13.2