toHostOrder

Converts the $(D_KEYWORD ubyte) input range range to T.

The byte order of r is assumed to be big-endian. The length cannot be larger than T.sizeof. Otherwise an assertion failure will be caused.

T
toHostOrder
(
T = size_t
R
)
()
if (
isInputRange!R &&
!isInfinite!R
&&
is(Unqual!(ElementType!R) == ubyte)
&&
)

Parameters

T

Desired return type.

R

Range type.

range R

Input range.

Return Value

Type: T

Integral representation of range with the host byte order.

Examples

const value = 0xae34e2u;
auto networkOrder = NetworkOrder!4(value);
assert(networkOrder.toHostOrder() == value);

Meta