FastLED
3.10.8
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
298
of file
flat_map.h
.
298
{
299
auto
key_copy
=
key
;
300
auto
it
=
lower_bound
(
key_copy
);
301
if
(
it
!=
end
() && !
mLess
(
key_copy
,
it
->first) && !
mLess
(
it
->first,
key_copy
)) {
302
if
(
result
) *
result
=
exists
;
303
return
false
;
304
}
305
bool
success
=
mData
.insert(
it
,
value_type
(
fl::move
(
key
),
fl::move
(
value
)));
306
if
(
success
) {
307
if
(
result
) *
result
=
inserted
;
308
return
true
;
309
}
310
if
(
result
) *
result
=
at_capacity
;
311
return
false
;
312
}
fl::flat_map::mLess
Less mLess
Definition
flat_map.h:54
fl::flat_map::value_type
fl::pair< Key, Value > value_type
Definition
flat_map.h:37
fl::flat_map::lower_bound
iterator lower_bound(const Key &key) FL_NO_EXCEPT
Definition
flat_map.h:208
fl::flat_map::end
iterator end() FL_NO_EXCEPT
Definition
flat_map.h:86
fl::flat_map::mData
vector_type mData
Definition
flat_map.h:53
fl::flat_map::at_capacity
@ at_capacity
Definition
flat_map.h:33
fl::flat_map::inserted
@ inserted
Definition
flat_map.h:33
fl::flat_map::exists
@ exists
Definition
flat_map.h:33
fl::flat_map
Definition
flat_map.h:31
fl
flat_map
Generated on Sun Oct 18 2026 00:57:06 for FastLED by
1.13.2