I'd like to clarify some conflicts I've encountered.
TDPL talks about ranges, it mentions random access ranges requiring these functions:
T at(int i)
Range slice(int x, int y)
But most code I encounter rather implements:
T opIndex(size_t i)
Range opSlice(size_t x, size_t y)
Which is it? Is there a distinction? One approach is deprecated?
Also, forward ranges require:
Range save()
But there is also this function:
Range opSlice()
With no args, handles the syntax 'range[]'. save() and opSlice() with no args would appear to be identical.
Why have both? Which will be used in which cases?