FastLED
3.9.15
Loading...
Searching...
No Matches
◆
insert()
[5/6]
template<typename
Key
, typename Value, typename Less = fl::less<Key>>
bool
fl::flat_map
<
Key
, Value, Less >::insert
(
Key
&&
key
,
Value &&
value
,
insert_result
*
result
=
nullptr
)
inline
Definition at line
304
of file
flat_map.h
.
304
{
305
auto
key_copy
=
key
;
306
auto
it
=
lower_bound
(
key_copy
);
307
if
(
it
!=
end
() && !
mLess
(
key_copy
,
it
->first) && !
mLess
(
it
->first,
key_copy
)) {
308
if
(
result
) *
result
=
exists
;
309
return
false
;
310
}
311
bool
success
=
mData
.insert(
it
,
value_type
(
fl::move
(
key
),
fl::move
(
value
)));
312
if
(
success
) {
313
if
(
result
) *
result
=
inserted
;
314
return
true
;
315
}
316
if
(
result
) *
result
=
at_capacity
;
317
return
false
;
318
}
fl::flat_map::mLess
Less mLess
Definition
flat_map.h:52
fl::flat_map::value_type
fl::pair< Key, Value > value_type
Definition
flat_map.h:35
fl::flat_map::lower_bound
iterator lower_bound(const Key &key) FL_NOEXCEPT
Definition
flat_map.h:166
fl::flat_map::end
iterator end() FL_NOEXCEPT
Definition
flat_map.h:84
fl::flat_map::mData
vector_type mData
Definition
flat_map.h:51
fl::flat_map::at_capacity
@ at_capacity
Definition
flat_map.h:31
fl::flat_map::inserted
@ inserted
Definition
flat_map.h:31
fl::flat_map::exists
@ exists
Definition
flat_map.h:31
fl::flat_map
Definition
flat_map.h:29
fl
flat_map
Generated on Tue Jun 16 2026 00:07:05 for FastLED by
1.13.2