Zig 0.17.0-dev (Split by item)

This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.

toNative

Converts an integer from specified endianness to host endianness.

mem.toNative
pub fn toNative(comptime T: type, x: T, endianness_of_x: Endian) T

File

lib/std/mem.zig:4231

Code

pub fn toNative(comptime T: type, x: T, endianness_of_x: Endian) T {
    return switch (endianness_of_x) {
        .little => littleToNative(T, x),
        .big => bigToNative(T, x),
    };
}