The OpenD Programming Language

mir.utility

Generic utilities.

Cheat Sheet
Function NameDescription
swapSwaps two values.
extMulExtended unsigned multiplications.
minMinimum value.
maxMaximum value.

Members

Functions

_expect
T _expect(T val, T expected_val)
_expect
T _expect(T val, T expected_val)
extMul
ExtMulResult!U extMul(U a, U b)

Extended unsigned multiplications. Performs U x U multiplication and returns ExtMulResult!U that contains extended result.

max
auto max(T args)

Iterates the passed arguments and returns the minimum value.

min
auto min(T args)

Iterates the passed arguments and returns the minimum value.

swap (from std.algorithm.mutation)
void swap(T lhs, T rhs) via public import std.algorithm.mutation : swap;

Swaps lhs and rhs. The instances lhs and rhs are moved in memory, without ever calling opAssign, nor any other function. T need not be assignable at all to be swapped.

Imports

_expect (from ldc.intrinsics)
public import ldc.intrinsics : _expect = llvm_expect;

Structs

ExtMulResult
struct ExtMulResult(I)

Return type for extMul;

Templates

simpleSort
template simpleSort(alias cmp = "a < b")

Simple sort algorithm usefull for CTFE code.

Meta

Authors

Ilia Ki, Andrei Alexandrescu (original std.* modules),