FastLED
3.9.15
Loading...
Searching...
No Matches
◆
insert()
[1/6]
template<typename
Key
, typename Value, typename Less = fl::less<Key>>
bool
fl::flat_map
<
Key
, Value, Less >::insert
(
const
Key
&
key
,
const Value &
value
,
insert_result
*
result
=
nullptr
)
inline
Definition at line
289
of file
flat_map.h
.
289
{
290
auto
it
=
lower_bound
(
key
);
291
if
(
it
!=
end
() && !
mLess
(
key
,
it
->first) && !
mLess
(
it
->first,
key
)) {
292
if
(
result
) *
result
=
exists
;
293
return
false
;
294
}
295
bool
success
=
mData
.insert(
it
,
value_type
(
key
,
value
));
296
if
(
success
) {
297
if
(
result
) *
result
=
inserted
;
298
return
true
;
299
}
300
if
(
result
) *
result
=
at_capacity
;
301
return
false
;
302
}
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