FastLED 3.10.8
Loading...
Searching...
No Matches

◆ try_emplace() [2/2]

template<typename Key, typename T, typename Hash = Hash<Key>, typename KeyEqual = EqualTo<Key>, int INLINED_COUNT = FASTLED_HASHMAP_INLINED_COUNT>
template<typename... Args>
pair< iterator, bool > fl::unordered_map< Key, T, Hash, KeyEqual, INLINED_COUNT >::try_emplace ( Key && k,
Args &&... args )
inline

Definition at line 515 of file unordered_map.h.

515 {
516 const bool will_rehash = needs_rehash();
517 if (will_rehash) {
518 if (_tombstones > _size) {
520 } else {
521 rehash_internal(_buckets.size() * 2);
522 }
523 }
525 bool is_new;
527 idx = p.first;
528 is_new = p.second;
529 if (is_new) {
530 // Key doesn't exist, construct in place with moved key
531 _buckets[idx].key = fl::move(k);
532 _buckets[idx].value = T(fl::forward<Args>(args)...);
534 ++_size;
535 }
536 // If not new, key already exists - don't move key or construct value
537 return {iterator(this, idx), is_new};
538 }
void rehash_internal(fl::size new_cap) FL_NO_EXCEPT
bool needs_rehash() const 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 move.h:30