\\Performs `result.* = a + b`. If overflow or underflow occurs, stores the overflowed bits in `result` and returns `true`. If no overflow or underflow occurs, returns `false`.
\\A [pointer alignment safety check](https://ziglang.org/documentation/0.8.0/#Incorrect-Pointer-Alignment) is added to the generated code to make sure the pointer is aligned as promised.
\\This function returns the number of bytes that this type should be aligned to for the current target to match the C ABI. When the child type of a pointer has this alignment, the alignment can be omitted from the type.
\\The result is a target-specific compile time constant. It is guaranteed to be less than or equal to [@sizeOf(T)](https://ziglang.org/documentation/0.8.0/#sizeOf).
\\Performs [Type Coercion](https://ziglang.org/documentation/0.8.0/#Type-Coercion). This cast is allowed when the conversion is unambiguous and safe, and is the preferred way to convert between types, whenever possible.
\\`@asyncCall` performs an `async` call on a function pointer, which may or may not be an [async function](https://ziglang.org/documentation/0.8.0/#Async-Functions).
\\
\\The provided `frame_buffer` must be large enough to fit the entire function frame. This size can be determined with [@frameSize](https://ziglang.org/documentation/0.8.0/#frameSize). To provide a too-small buffer invokes safety-checked [Undefined Behavior](https://ziglang.org/documentation/0.8.0/#Undefined-Behavior).
\\`result_ptr` is optional ([null](https://ziglang.org/documentation/0.8.0/#null) may be provided). If provided, the function call will write its result directly to the result pointer, which will be available to read after [await](https://ziglang.org/documentation/0.8.0/#Async-and-Await) completes. Any result location provided to `await` will copy the result from `result_ptr`.
\\Works at compile-time if `value` is known at compile time. It's a compile error to bitcast a struct to a scalar type of the same size since structs have undefined layout. However if the struct is packed then it works.
\\For non [packed structs](https://ziglang.org/documentation/0.8.0/#packed-struct), this will always be divisible by `8`. For packed structs, non-byte-aligned fields will share a byte offset, but they will have different bit offsets.
\\Swaps the byte order of the integer. This converts a big endian integer to a little endian integer, and converts a little endian integer to a big endian integer.
\\Note that for the purposes of memory layout with respect to endianness, the integer type should be related to the number of bytes reported by [@sizeOf](https://ziglang.org/documentation/0.8.0/#sizeOf) bytes. This is demonstrated with `u24`. `@sizeOf(u24) == 4`, which means that a `u24` stored in memory takes 4 bytes, and those 4 bytes are what are swapped on a little vs big endian system. On the other hand, if `T` is specified to be `u24`, then only 3 bytes are reversed.
\\This function parses C code and imports the functions, types, variables, and compatible macro definitions into a new empty struct type, and then returns that type.
\\
\\`expression` is interpreted at compile time. The builtin functions `@cInclude`, `@cDefine`, and `@cUndef` work within this expression, appending to a temporary buffer which is then parsed as C code.
\\
\\Usually you should only have one `@cImport` in your entire application, because it saves the compiler from invoking clang multiple times, and prevents inline functions from being duplicated.
\\
\\Reasons for having multiple `@cImport` expressions would be:
\\If `integer` is known at [comptime](https://ziglang.org/documentation/0.8.0/#comptime), the return type is `comptime_int`. Otherwise, the return type is an unsigned integer with the minimum number of bits that can represent the bit count of the integer type.
\\If you are using cmpxchg in a loop, [@cmpxchgWeak](https://ziglang.org/documentation/0.8.0/#cmpxchgWeak) is the better choice, because it can be implemented more efficiently in machine instructions.
\\ if (old_value == expected_value and usuallyTrueButSometimesFalse()) {
\\ ptr.* = new_value;
\\ return null;
\\ } else {
\\ return old_value;
\\ }
\\}
\\```
\\If you are using cmpxchg in a loop, the sporadic failure will be no problem, and `cmpxchgWeak` is the better choice, because it can be implemented more efficiently in machine instructions. However if you need a stronger guarantee, use [@cmpxchgStrong](https://ziglang.org/documentation/0.8.0/#cmpxchgStrong).
\\This function, when semantically analyzed, causes a compile error with the message `msg`.
\\
\\There are several ways that code avoids being semantically checked, such as using `if` or `switch` with compile time constants, and `comptime` functions.
,
.arguments=&.{
"comptime msg: []u8",
},
},
.{
.name="@compileLog",
.signature="@compileLog(args: ...)",
.snippet="@compileLog(${1:args: ...})",
.documentation=
\\This function prints the arguments passed to it at compile-time.
\\
\\To prevent accidentally leaving compile log statements in a codebase, a compilation error is added to the build, pointing to the compile log statement. This error prevents code from being generated, but does not otherwise interfere with analysis.
\\
\\This function can be used to do "printf debugging" on compile-time executing code.
\\
\\```zig
\\const print = @import("std").debug.print;
\\const num1 = blk: {
\\ var val1: i32 = 99;
\\ @compileLog("comptime val1 = ", val1);
\\ val1 = val1 + 1;
\\ break :blk val1;
\\};
\\test "main" {
\\ @compileLog("comptime in main");
\\ print("Runtime in main, num1 = {}.\n", .{num1});
\\If `integer` is known at [comptime](https://ziglang.org/documentation/0.8.0/#comptime), the return type is `comptime_int`. Otherwise, the return type is an unsigned integer with the minimum number of bits that can represent the bit count of the integer type.
\\Floored division. Rounds toward negative infinity. For unsigned integers it is the same as `numerator / denominator`. Caller guarantees `denominator != 0` and `!(@typeInfo(T) == .Int and T.is_signed and numerator == std.math.minInt(T) and denominator == -1)`.
\\Truncated division. Rounds toward zero. For unsigned integers it is the same as `numerator / denominator`. Caller guarantees `denominator != 0` and `!(@typeInfo(T) == .Int and T.is_signed and numerator == std.math.minInt(T) and denominator == -1)`.
\\This function returns a compile time constant pointer to null-terminated, fixed-size array with length equal to the byte count of the file given by `path`. The contents of the array are the contents of the file. This is equivalent to a [string literal](https://ziglang.org/documentation/0.8.0/#String-Literals-and-Unicode-Code-Point-Literals) with the file contents.
\\This function returns the string representation of an error. The string representation of `error.OutOfMem` is `"OutOfMem"`.
\\
\\If there are no calls to `@errorName` in an entire application, or all calls have a compile-time known value for `err`, then no error name table will be generated.
\\If the binary is built with error return tracing, and this function is invoked in a function that calls a function with an error or error union return type, returns a stack trace object. Otherwise returns [null](https://ziglang.org/documentation/0.8.0/#null).
\\Converts an error value from one error set to another error set. Attempting to convert an error which is not in the destination error set results in safety-protected [Undefined Behavior](https://ziglang.org/documentation/0.8.0/#Undefined-Behavior).
\\This function can be called from a [comptime](https://ziglang.org/documentation/0.8.0/#comptime) block to conditionally export symbols. When `identifier` is a function with the C calling convention and `options.linkage` is `Strong`, this is equivalent to the `export` keyword used on a function:
\\If the integer part of the floating point number cannot fit in the destination type, it invokes safety-checked [Undefined Behavior](https://ziglang.org/documentation/0.8.0/#Undefined-Behavior).
\\This function returns a pointer to the frame for a given function. This type can be [coerced](https://ziglang.org/documentation/0.8.0/#Type-Coercion) to `anyframe->T` and to `anyframe`, where `T` is the return type of the function in scope.
\\This function does not mark a suspension point, but it does cause the function in scope to become an [async function](https://ziglang.org/documentation/0.8.0/#Async-Functions).
\\This function returns the frame type of a function. This works for [Async Functions](https://ziglang.org/documentation/0.8.0/#Async-Functions) as well as any function without a specific calling convention.
\\This type is suitable to be used as the return type of [async](https://ziglang.org/documentation/0.8.0/#Async-and-Await) which allows one to, for example, heap-allocate an async function frame:
\\This function returns the base pointer of the current stack frame.
\\
\\The implications of this are target specific and not consistent across all platforms. The frame address may not be available in release mode due to aggressive optimizations.
\\
\\This function is only valid within function scope.
,
.arguments=&.{},
},
.{
.name="@frameSize",
.signature="@frameSize() usize",
.snippet="@frameSize()",
.documentation=
\\This is the same as `@sizeOf(@Frame(func))`, where `func` may be runtime-known.
\\Returns whether or not a [struct](https://ziglang.org/documentation/0.8.0/#struct), [enum](https://ziglang.org/documentation/0.8.0/#enum), or [union](https://ziglang.org/documentation/0.8.0/#union) has a declaration matching `name`.
\\
\\```zig
\\const std = @import("std");
\\const expect = std.testing.expect;
\\const Foo = struct {
\\ nope: i32,
\\ pub var blah = "xxx";
\\ const hi = 1;
\\};
\\test "@hasDecl" {
\\ try expect(@hasDecl(Foo, "blah"));
\\ // Even though `hi` is private, @hasDecl returns true because this test is
\\ // in the same file scope as Foo. It would return false if Foo was declared
\\Returns whether the field name of a struct, union, or enum exists.
\\
\\The result is a compile time constant.
\\
\\It does not include functions, variables, or constants.
,
.arguments=&.{
"comptime Container: type",
"comptime name: []const u8",
},
},
.{
.name="@import",
.signature="@import(comptime path: []u8) type",
.snippet="@import(${1:comptime path: []u8})",
.documentation=
\\This function finds a zig file corresponding to `path` and adds it to the build, if it is not already added.
\\
\\Zig source files are implicitly structs, with a name equal to the file's basename with the extension truncated. `@import` returns the struct type corresponding to the file.
\\
\\Declarations which have the `pub` keyword may be referenced from a different source file than the one they are declared in.
\\
\\`path` can be a relative path or it can be the name of a package. If it is a relative path, it is relative to the file that contains the `@import` function call.
\\Converts an integer to another integer while keeping the same numerical value. Attempting to convert a number which is out of range of the destination type results in safety-protected [Undefined Behavior](https://ziglang.org/documentation/0.8.0/#Undefined-Behavior).
\\Attempting to convert an integer which represents no value in the chosen enum type invokes safety-checked [Undefined Behavior](https://ziglang.org/documentation/0.8.0/#Undefined-Behavior).
\\Converts from the integer representation of an error into [The Global Error Set](https://ziglang.org/documentation/0.8.0/#The-Global-Error-Set) type.
\\Attempting to convert an integer that does not correspond to any error results in safety-protected [Undefined Behavior](https://ziglang.org/documentation/0.8.0/#Undefined-Behavior).
\\Converts an integer to the closest floating point representation. To convert the other way, use [@floatToInt](https://ziglang.org/documentation/0.8.0/#floatToInt). This cast is always safe.
\\Converts an integer to a [pointer](https://ziglang.org/documentation/0.8.0/#Pointers). To convert the other way, use [@ptrToInt](https://ziglang.org/documentation/0.8.0/#ptrToInt).
\\If the destination pointer type does not allow address zero and `address` is zero, this invokes safety-checked [Undefined Behavior](https://ziglang.org/documentation/0.8.0/#Undefined-Behavior).
\\The optimizer is intelligent enough to turn the above snippet into a memset.
\\
\\There is also a standard library function for this:
\\
\\```zig
\\const mem = @import("std").mem;
\\mem.set(u8, dest, c);
\\```
,
.arguments=&.{
"dest: [*]u8",
"c: u8",
"byte_count: usize",
},
},
.{
.name="@wasmMemorySize",
.signature="@wasmMemorySize(index: u32) u32",
.snippet="@wasmMemorySize(${1:index: u32})",
.documentation=
\\This function returns the size of the Wasm memory identified by `index` as an unsigned value in units of Wasm pages. Note that each Wasm page is 64KB in size.
\\
\\This function is a low level intrinsic with no safety mechanisms usually useful for allocator designers targeting Wasm. So unless you are writing a new allocator from scratch, you should use something like `@import("std").heap.WasmPageAllocator`.
\\This function increases the size of the Wasm memory identified by `index` by `delta` in units of unsigned number of Wasm pages. Note that each Wasm page is 64KB in size. On success, returns previous memory size; on failure, if the allocation fails, returns -1.
\\This function is a low level intrinsic with no safety mechanisms usually useful for allocator designers targeting Wasm. So unless you are writing a new allocator from scratch, you should use something like `@import("std").heap.WasmPageAllocator`.
\\Performs `result.* = a * b`. If overflow or underflow occurs, stores the overflowed bits in `result` and returns `true`. If no overflow or underflow occurs, returns `false`.
\\Invokes the panic handler function. By default the panic handler function calls the public `panic` function exposed in the root source file, or if there is not one specified, the `std.builtin.default_panic` function from `std/builtin.zig`.
\\
\\Generally it is better to use `@import("std").debug.panic`. However, `@panic` can be useful for 2 scenarios:
\\If `integer` is known at [comptime](https://ziglang.org/documentation/0.8.0/#comptime), the return type is `comptime_int`. Otherwise, the return type is an unsigned integer with the minimum number of bits that can represent the bit count of the integer type.
\\[Optional Pointers](https://ziglang.org/documentation/0.8.0/#Optional-Pointers) are allowed. Casting an optional pointer which is [null](https://ziglang.org/documentation/0.8.0/#null) to a non-optional pointer invokes safety-checked [Undefined Behavior](https://ziglang.org/documentation/0.8.0/#Undefined-Behavior).
\\For a function that returns an error code, see `@import("std").math.rem`.
,
.arguments=&.{
"numerator: T",
"denominator: T",
},
},
.{
.name="@returnAddress",
.signature="@returnAddress() usize",
.snippet="@returnAddress()",
.documentation=
\\This function returns the address of the next machine code instruction that will be executed when the current function returns.
\\
\\The implications of this are target specific and not consistent across all platforms.
\\
\\This function is only valid within function scope. If the function gets inlined into a calling function, the returned address will apply to the calling function.
\\ - `Optimized` - Floating point operations may do all of the following:
\\ - Assume the arguments and result are not NaN. Optimizations are required to retain defined behavior over NaNs, but the value of the result is undefined.
\\ - Assume the arguments and result are not +/-Inf. Optimizations are required to retain defined behavior over +/-Inf, but the value of the result is undefined.
\\ - Treat the sign of a zero argument or result as insignificant.
\\ - Use the reciprocal of an argument rather than perform division.
\\ - Perform floating-point contraction (e.g. fusing a multiply followed by an addition into a fused multiply-and-add).
\\ - Perform algebraically equivalent transformations that may change results in floating point (e.g. reassociate).
\\The floating point mode is inherited by child scopes, and can be overridden in any scope. You can set the floating point mode in a struct or module scope by using a comptime block.
\\Each element in `mask` selects an element from either `a` or `b`. Positive numbers select from `a` starting at 0. Negative values select from `b`, starting at `-1` and going down. It is recommended to use the `~` operator from indexes from `b` so that both indexes can start from `0` (i.e. `~@as(i32, 0)` is `-1`).
\\
\\For each element of `mask`, if it or the selected value from `a` or `b` is `undefined`, then the resulting element is `undefined`.
\\
\\`a_len` and `b_len` may differ in length. Out-of-bounds element indexes in `mask` result in compile errors.
\\
\\If `a` or `b` is `undefined`, it is equivalent to a vector of all `undefined` with the same length as the other vector. If both vectors are `undefined`, `@shuffle` returns a vector with all elements `undefined`.
\\`E` must be an [integer](https://ziglang.org/documentation/0.8.0/#Integers), [float](https://ziglang.org/documentation/0.8.0/#Floats), [pointer](https://ziglang.org/documentation/0.8.0/#Pointers), or `bool`. The mask may be any vector length, and its length determines the result length.
\\This size may contain padding bytes. If there were two consecutive T in memory, this would be the offset in bytes between element at index 0 and the element at index 1. For [integer](https://ziglang.org/documentation/0.8.0/#Integers), consider whether you want to use `@sizeOf(T)` or `@typeInfo(T).Int.bits`.
\\`scalar` must be an [integer](https://ziglang.org/documentation/0.8.0/#Integers), [bool](https://ziglang.org/documentation/0.8.0/#Primitive-Types), [float](https://ziglang.org/documentation/0.8.0/#Floats), or [pointer](https://ziglang.org/documentation/0.8.0/#Pointers).
\\Transforms a [vector](https://ziglang.org/documentation/0.8.0/#Vectors) into a scalar value by performing a sequential horizontal reduction of its elements using the specified operator `op`.
\\ - `.And`, `.Or`, `.Xor` are available for `bool` vectors,
\\ - `.Min`, `.Max`, `.Add`, `.Mul` are available for [floating point](https://ziglang.org/documentation/0.8.0/#Floats) vectors,
\\ - Every operator is available for [integer](https://ziglang.org/documentation/0.8.0/#Integers) vectors.
\\Note that `.Add` and `.Mul` reductions on integral types are wrapping; when applied on floating point types the operation associativity is preserved, unless the float mode is set to `Optimized`.
\\Supports [Floats](https://ziglang.org/documentation/0.8.0/#Floats) and [Vectors](https://ziglang.org/documentation/0.8.0/#Vectors) of floats, with the caveat that
\\[some float operations are not yet implemented for all float types](https://github.com/ziglang/zig/issues/4026).
\\Supports [Floats](https://ziglang.org/documentation/0.8.0/#Floats) and [Vectors](https://ziglang.org/documentation/0.8.0/#Vectors) of floats, with the caveat that
\\[some float operations are not yet implemented for all float types](https://github.com/ziglang/zig/issues/4026).
\\Supports [Floats](https://ziglang.org/documentation/0.8.0/#Floats) and [Vectors](https://ziglang.org/documentation/0.8.0/#Vectors) of floats, with the caveat that
\\[some float operations are not yet implemented for all float types](https://github.com/ziglang/zig/issues/4026).
\\Supports [Floats](https://ziglang.org/documentation/0.8.0/#Floats) and [Vectors](https://ziglang.org/documentation/0.8.0/#Vectors) of floats, with the caveat that
\\[some float operations are not yet implemented for all float types](https://github.com/ziglang/zig/issues/4026).
\\Supports [Floats](https://ziglang.org/documentation/0.8.0/#Floats) and [Vectors](https://ziglang.org/documentation/0.8.0/#Vectors) of floats, with the caveat that
\\[some float operations are not yet implemented for all float types](https://github.com/ziglang/zig/issues/4026).
\\Supports [Floats](https://ziglang.org/documentation/0.8.0/#Floats) and [Vectors](https://ziglang.org/documentation/0.8.0/#Vectors) of floats, with the caveat that
\\[some float operations are not yet implemented for all float types](https://github.com/ziglang/zig/issues/4026).
\\Supports [Floats](https://ziglang.org/documentation/0.8.0/#Floats) and [Vectors](https://ziglang.org/documentation/0.8.0/#Vectors) of floats, with the caveat that
\\[some float operations are not yet implemented for all float types](https://github.com/ziglang/zig/issues/4026).
\\Supports [Floats](https://ziglang.org/documentation/0.8.0/#Floats) and [Vectors](https://ziglang.org/documentation/0.8.0/#Vectors) of floats, with the caveat that
\\[some float operations are not yet implemented for all float types](https://github.com/ziglang/zig/issues/4026).
\\Supports [Floats](https://ziglang.org/documentation/0.8.0/#Floats) and [Vectors](https://ziglang.org/documentation/0.8.0/#Vectors) of floats, with the caveat that
\\[some float operations are not yet implemented for all float types](https://github.com/ziglang/zig/issues/4026).
\\Supports [Floats](https://ziglang.org/documentation/0.8.0/#Floats) and [Vectors](https://ziglang.org/documentation/0.8.0/#Vectors) of floats, with the caveat that
\\[some float operations are not yet implemented for all float types](https://github.com/ziglang/zig/issues/4026).
\\Supports [Floats](https://ziglang.org/documentation/0.8.0/#Floats) and [Vectors](https://ziglang.org/documentation/0.8.0/#Vectors) of floats, with the caveat that
\\[some float operations are not yet implemented for all float types](https://github.com/ziglang/zig/issues/4026).
\\Supports [Floats](https://ziglang.org/documentation/0.8.0/#Floats) and [Vectors](https://ziglang.org/documentation/0.8.0/#Vectors) of floats, with the caveat that
\\[some float operations are not yet implemented for all float types](https://github.com/ziglang/zig/issues/4026).
\\Supports [Floats](https://ziglang.org/documentation/0.8.0/#Floats) and [Vectors](https://ziglang.org/documentation/0.8.0/#Vectors) of floats, with the caveat that
\\[some float operations are not yet implemented for all float types](https://github.com/ziglang/zig/issues/4026).
\\Performs `result.* = a - b`. If overflow or underflow occurs, stores the overflowed bits in `result` and returns `true`. If no overflow or underflow occurs, returns `false`.
\\If the enum is non-exhaustive and the tag value does not map to a name, it invokes safety-checked [Undefined Behavior](https://ziglang.org/documentation/0.8.0/#Undefined-Behavior).
\\Returns the innermost struct, enum, or union that this function call is inside. This can be useful for an anonymous struct that needs to refer to itself:
\\For [structs](https://ziglang.org/documentation/0.8.0/#struct), [unions](https://ziglang.org/documentation/0.8.0/#union), [enums](https://ziglang.org/documentation/0.8.0/#enum), and [error sets](https://ziglang.org/documentation/0.8.0/#Error-Set-Type), the fields are guaranteed to be in the same order as declared. For declarations, the order is unspecified.
\\`@TypeOf` is a special builtin function that takes any (nonzero) number of expressions as parameters and returns the type of the result, using [Peer Type Resolution](https://ziglang.org/documentation/0.8.0/#Peer-Type-Resolution).
\\
\\The expressions are evaluated, however they are guaranteed to have no
\\This is the same thing as [union](https://ziglang.org/documentation/0.8.0/#union) initialization syntax, except that the field name is a [comptime](https://ziglang.org/documentation/0.8.0/#comptime)-known value rather than an identifier token.