StaticBitArray.sort

Sorts the StaticBitArray's elements.

struct StaticBitArray(uint capacity, Block = DefaultBlock)
@safe @property
typeof(this)
sort
()
()
in (result == this)
out (result) { if (capacity >= 2) { size_t lo, hi; lo = 0; hi = capacity - 1; while (1) { while (1) { if (lo >= hi) goto Ldone; if (this[lo] == true) break; lo++; } while (1) { if (lo >= hi) goto Ldone; if (this[hi] == false) break; hi--; } this[lo] = false; this[hi] = true; lo++; hi--; } } Ldone: return this; }
if (
isUnsigned!DefaultBlock
)

Meta