FastLED
3.9.15
Loading...
Searching...
No Matches
◆
insert()
[1/2]
template<typename T, fl::size INLINED_SIZE>
bool
fl::InlinedVector
< T, INLINED_SIZE >::insert
(
iterator
pos
,
const T &
value
)
inline
Definition at line
1134
of file
vector.h
.
1134
{
1135
if
(
mUsingHeap
) {
1136
// return insert(pos, value);
1137
return
mHeap
.insert(
pos
,
value
);
1138
}
1139
1140
if
(
mFixed
.size() <
INLINED_SIZE
) {
1141
return
mFixed
.insert(
pos
,
value
);
1142
}
1143
1144
// fl::size diff = pos - mFixed.begin();
1145
// make safe for data that grows down
1146
fl::size
idx
=
mFixed
.end() -
pos
;
1147
1148
// overflow: move inline data into heap
1149
mHeap
.reserve(
INLINED_SIZE
* 2);
1150
for
(
auto
&
v
:
mFixed
) {
1151
mHeap
.push_back(
v
);
1152
}
1153
mFixed
.clear();
1154
return
mHeap
.insert(
mHeap
.begin() +
idx
,
value
);
1155
}
fl::InlinedVector::mHeap
HeapVector< T > mHeap
Definition
vector.h:1211
fl::InlinedVector::mFixed
FixedVector< T, INLINED_SIZE > mFixed
Definition
vector.h:1210
fl::InlinedVector::mUsingHeap
bool mUsingHeap
Definition
vector.h:1209
fl::InlinedVector
Definition
vector.h:888
References
mFixed
,
mHeap
,
mUsingHeap
, and
pos
.
fl
InlinedVector
Generated on Fri Aug 22 2025 20:59:36 for FastLED by
1.13.2