CachedRange

Represents a ForwardRange (and a RandomAccessRange when possible) over the cached elements of a source range. Provides the range algorithm length() only if the source range does so.

Destructor

~this
~this()

Unregisters this slices from the actual ElementCache storage.

Postblit

this(this)
this(this)
Undocumented in source.

Members

Functions

empty
auto empty()

Whether the range is empty

front
auto front()

The front element of the range

length
auto length()

Number of elements of this range

opApply
int opApply(int delegate(const(EC.ET)) func)
int opApply(int delegate(size_t, const(EC.ET)) func)

Support for foreach loops

opIndex
auto opIndex(size_t index)

Return a reference to an element

popFront
void popFront()

Remove the front element from the range

save
auto save()

Make and return a new ForwardRange object that is the equivalent of this range object

stats
Stats stats()

Return statistics about the operation of ElementCache as well as the underlying CircularBlocks that it uses for element storage

Parameters

EC

the template instance of the ElementCache template that this range provides access to the elements of. The users are expected to call one of the cached functions, which sets this parameter automatically.

Meta