FastLED 3.10.9
Loading...
Searching...
No Matches

◆ insert_or_assign() [1/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 ( const Key & key,
T && value )
inline

Definition at line 416 of file unordered_map.h.

416 {
417 const bool will_rehash = needs_rehash();
418 if (will_rehash) {
419 if (_tombstones > _size) {
421 } else {
422 rehash_internal(_buckets.size() * 2);
423 }
424 }
426 bool is_new;
428 idx = p.first;
429 is_new = p.second;
430 if (is_new) {
431 _buckets[idx].key = key;
432 _buckets[idx].value = fl::move(value);
434 ++_size;
435 } else {
436 FASTLED_ASSERT(idx != npos(), "unordered_map::insert_or_assign: invalid index");
437 _buckets[idx].value = fl::move(value);
438 }
439 return {iterator(this, idx), is_new};
440 }
void rehash_internal(fl::size new_cap) FL_NO_EXCEPT
bool needs_rehash() const FL_NO_EXCEPT
static fl::size npos() FL_NO_EXCEPT
fl::vector_inlined< Entry, INLINED_COUNT > _buckets
void mark_occupied(fl::size idx) FL_NO_EXCEPT
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_NULL_DEREFERENCE void rehash_inline_no_resize() FL_NO_EXCEPT
pair< fl::size, bool > find_slot(const Key &key) const FL_NO_EXCEPT
constexpr remove_reference< T >::type && move(T &&t) FL_NO_EXCEPT
Definition s16x16x4.h:30