...

/

RandomAccessRange: Infinite

RandomAccessRange: Infinite

an overview of RandomAccessRange and the infinite RandomAccessRange.

We'll cover the following...

RandomAccessRange

RandomAccessRange represents ranges that allow accessing elements by the [] operator. As we covered in the operator overloading chapter, [] operator is defined by the opIndex() member function.

Importing the std.array module makes slices become RandomAccessRange ranges only if possible. For example, since UTF-8 and UTF-16 encodings do not allow accessing Unicode characters by an index, char and wchar arrays cannot be used as RandomAccessRange ranges of Unicode characters. On the other hand, since the codes of the UTF-32 encoding correspond ...