FastLED
3.9.15
Loading...
Searching...
No Matches
◆
insert()
[2/2]
template<typename
Key
, typename Value, fl::size N>
pair
< bool,
iterator
>
fl::FixedMap
<
Key
, Value, N >::insert
(
Key
&&
key
,
Value &&
value
,
InsertResult
*
result
=
nullptr
)
inline
Definition at line
151
of file
map.h
.
152
{
153
iterator
it
=
find
(
key
);
154
if
(
it
!=
end
()) {
155
if
(
result
) {
156
*
result
=
InsertResult::kExists
;
157
}
158
return
{
false
,
it
};
159
}
160
if
(
data
.size() <
N
) {
161
data
.push_back(
PairKV
(
fl::move
(
key
),
fl::move
(
value
)));
162
if
(
result
) {
163
*
result
=
InsertResult::kInserted
;
164
}
165
return
{
true
,
data
.end() - 1};
166
}
167
if
(
result
) {
168
*
result
=
InsertResult::kMaxSize
;
169
}
170
return
{
false
,
end
()};
171
}
fl::FixedMap::iterator
VectorType::iterator iterator
Definition
map.h:29
fl::FixedMap::end
iterator end()
Definition
map.h:36
fl::FixedMap::data
VectorType data
Definition
map.h:264
fl::FixedMap::PairKV
fl::pair< Key, Value > PairKV
Definition
map.h:26
fl::FixedMap::find
iterator find(const Key &key)
Definition
map.h:40
fl::FixedMap
Definition
map.h:24
fl
FixedMap
Generated on Fri Aug 22 2025 20:59:36 for FastLED by
1.13.2