HashTable.eraseIter

Deletes entry from the table by its iterator.

Arguments

iterator
is a HashTableIterator pointing to the entry to erase. The iterator and all ranges that include it as a “first” or an “end” iterator become invalid. If the iterator is an “end” iterator, an error will occur.

Return values

None

Complexity

Constant

Example

"sl/hashTable" useFile a: HashTable; 0 "ZERO" a.insert 34 "element" a.insert -25 "element" a.insert 35 "element" a.insert 34n8 135 a.insert 32 { a:0; b:1; } a.insert mod2: [drop FALSE] func; mod2: [2 mod 0 =] [drop TRUE] pfunc; a [it:; it.get.key mod2 [it a.eraseIter] when TRUE] enumIter a [print LF print TRUE] enum
Output:
{ key: 34; value: 135; } { key: -25; value: "element"; } { key: 35; value: "element"; }