flip

Flips the given integral value

T
flip
(
T
)
if (
__traits(isIntegral, T)
)

Parameters

bytesIn T

the integral value

Return Value

Type: T

the flipped integral

Examples

Tests the flip!(T)(T) function

version(BigEndian)
{
    ushort i = 1;
    ushort flipped = flip(i);
    assert(flipped == 256);
}
else version(LittleEndian)
{
    ushort i = 1;
    ushort flipped = flip(i);
    assert(flipped == 256);
}

Meta