MergeArray.tryApplyEachUntil

Applies dg to each element in cyclic fashion until it returns true or the MergeArray is disrupted by a merge.

dg is applied to each element in turn, such that once dg is applied to an element, it is not reapplied to the same element until width-1 other applications of dg finished and all returned false.

If this is merged with another MergeArray with a lower Handle id, such that the Objs in this are mergeSteal'd from, then the further applications of dg will stop.

Warning: The applications of dg are NOT collectively atomic, only individually atomic.

Progress: Deadlock-free if dg returns true after a finite number of applications.

struct MergeArray(Obj)
shared
bool
tryApplyEachUntil
(
scope bool delegate
(
Obj*
)
dg
)
if (
is(Obj == struct) &&
!is(Obj == shared)
)

Return Value

Type: bool

true if an application of dg returns true, or false if this was merged into another MergeArray before dg could return true.

Meta