The OpenD Programming Language

UnrolledList.constRange

Create new const range. Const range preserve it's correctness by preventing you from any list mutations.

const range is value type` - assignment and initializations create its copy.

const range can't make warranties on it's correctnes if you make any list mutation. So, while you have any active const range you can't make any mutation to list. At any atempt to remove, insert or clear list while const range active you'll get AssertionError. To make constRange inactive you have to consume it to the end or call reset on it.

import ikod.containers.unrolledlist;
struct UnrolledList(T, Allocator = Mallocator, bool GCRangesAllowed = true)
alias constRange = makeRange!"const"

Meta