FastLED 3.9.15
Loading...
Searching...
No Matches

◆ insert_or_assign() [2/2]

template<typename Key, typename T, typename Hash = Hash<Key>, typename KeyEqual = EqualTo<Key>, int INLINED_COUNT = FASTLED_HASHMAP_INLINED_COUNT>
pair< iterator, bool > fl::unordered_map< Key, T, Hash, KeyEqual, INLINED_COUNT >::insert_or_assign ( Key && key,
T && value )
inline

Definition at line 442 of file unordered_map.h.

442 {
443 const bool will_rehash = needs_rehash();
444 if (will_rehash) {
445 if (_tombstones > _size) {
447 } else {
448 rehash_internal(_buckets.size() * 2);
449 }
450 }
452 bool is_new;
454 idx = p.first;
455 is_new = p.second;
456 if (is_new) {
457 _buckets[idx].key = fl::move(key);
458 _buckets[idx].value = fl::move(value);
460 ++_size;
461 } else {
462 FASTLED_ASSERT(idx != npos(), "unordered_map::insert_or_assign: invalid index");
463 _buckets[idx].value = fl::move(value);
464 }
465 return {iterator(this, idx), is_new};
466 }
static fl::size npos()
void mark_occupied(fl::size idx)
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_NULL_DEREFERENCE void rehash_inline_no_resize()
fl::vector_inlined< Entry, INLINED_COUNT > _buckets
pair< fl::size, bool > find_slot(const Key &key) const
bool needs_rehash() const
void rehash_internal(fl::size new_cap)
constexpr remove_reference< T >::type && move(T &&t) FL_NOEXCEPT
Definition s16x16x4.h:28