FastLED
3.9.15
Loading...
Searching...
No Matches
◆
insert()
[1/2]
template<typename T, fl::size N>
bool
fl::FixedVector
< T, N >::insert
(
iterator
pos
,
const T &
value
)
inline
Definition at line
258
of file
vector.h
.
258
{
259
if
(
current_size
<
N
) {
260
// shift all element from pos to end to the right
261
for
(
iterator
p
=
end
();
p
!=
pos
; --
p
) {
262
T
temp
=
fl::move
(*(
p
- 1));
263
(
p
)->~
T
();
// Destroy the current element
264
// Clear the memory
265
void
*
vp
=
static_cast<
void
*
>
(
p
);
266
fl::memfill
(
vp
, 0,
sizeof
(
T
));
267
new
(
p
)
T
(
fl::move
(
temp
));
// Use move constructor
268
}
269
++
current_size
;
270
// now insert the new value
271
new
(
pos
)
T
(
value
);
272
return
true
;
273
}
274
return
false
;
275
}
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