BucketSet.Iterator

'foreach' iteration over elements in the set. DO NOT change the element keys during iteration because this will corrupt the map (unless it is guaranteed that the element will go to the same bucket).

Constructors

this
this(bool reset_after_foreach)

Ctor

Members

Functions

opApply
int opApply(int delegate(ref Bucket.Element element) dg)

Foreach support

opApply
int opApply(int delegate(ref size_t i, ref Bucket.Element element) dg)

Foreach support with counter

reset
void reset()

Reset the counters, effectively forcing any interrupted iteration to start from the beginning.

resetIterator
void resetIterator(bool interrupted)

if reset_after_foreach is true: resets the counters after each foreach so the next iteration starts from the beginning

Variables

counter
size_t counter;

Total count of the elements currently iterated

last_bucket_element
size_t last_bucket_element;

Last element within the last bucket that was iterated

last_bucket_index
size_t last_bucket_index;

Index of the last bucket that was iterated in the last call to foreach

reset_after_foreach
bool reset_after_foreach;

Whether to reset the counter after each foreach

Meta