asN

@safe @property ref @trusted pure nothrow @nogc
inout(E)[T.sizeof]
asN
(
E
T
)
(
inout ref T x
)
if (
T.sizeof % E.sizeof == 0
)

Return Value

Type: inout(E)[T.sizeof]

x as a static array with elements of type E.

Examples

immutable ushort x = 17;
auto y = x.asN!ubyte;
version(LittleEndian)
	assert(y == [17, 0].s);

Meta