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

◆ erase() [2/3]

template<typename Key, typename T, typename Hash = Hash<Key>, typename KeyEqual = EqualTo<Key>, int INLINED_COUNT = FASTLED_HASHMAP_INLINED_COUNT>
iterator fl::unordered_map< Key, T, Hash, KeyEqual, INLINED_COUNT >::erase ( const_iterator first,
const_iterator last )
inline

Definition at line 572 of file unordered_map.h.

572 {
573 if (first._map != this || last._map != this) {
574 return end(); // Invalid iterators
575 }
576
577 // Erase each element in the range
578 // We need to convert const_iterator to iterator for the return value
579 iterator current(this, first._idx);
580 current.advance_to_occupied();
581
582 while (current != end() && current._idx < last._idx) {
584 ++current;
585 current.advance_to_occupied();
586
587 // Erase the element at idx_to_erase
589 --_size;
590 ++_tombstones;
591 }
592
593 return current;
594 }
void mark_deleted(fl::size idx)