peek

fnT peek(T, Endian endianness = Endian.bigEndian, R)(R range) if (canSwapEndianness!T && isForwardRange!R && is(ElementType!R : const ubyte))

Takes a range of ubytes and converts the first T.sizeof bytes to T. The value returned is converted from the given endianness to the native endianness. The range is not consumed.

Parameters

TThe integral type to convert the first T.sizeof bytes to.
endiannessThe endianness that the bytes are assumed to be in.
rangeThe range to read from.
indexThe index to start reading from (instead of starting at the front). If index is a pointer, then it is updated to the index after the bytes read. The overloads with index are only available if hasSlicing!R is true.
fnT peek(T, Endian endianness = Endian.bigEndian, R)(R range, size_t index) if (canSwapEndianness!T && isForwardRange!R && hasSlicing!R && is(ElementType!R : const ubyte))

Ditto

fnT peek(T, Endian endianness = Endian.bigEndian, R)(R range, size_t * index) if (canSwapEndianness!T && isForwardRange!R && hasSlicing!R && is(ElementType!R : const ubyte))

Ditto