BTW, there's no fast way to boundcheck two-ptr range. It should work similar to opSlice: T opIndex(size_t index) { static if (CHECKED) assert(index < end-ptr); return *(ptr + index); }