core.internal.dassert

Functions 10

fnstring _d_assert_fail(A)(const scope string op, auto ref const scope A a)Generates rich assert error messages for unary expressions
private fnstring combine(const scope string[] valA, const scope string token, const scope string[] valB) pure nothrow @nogc @safeCombines the supplied arguments into one string `"valA token valB"`
private fnstring miniFormat(V)(const scope ref V v)Generates a textual representation of `v` without relying on Phobos. The value is formatted as follows:
private fnstring formatMembers(V)(const scope ref V v)Formats `v`'s members as `V(<member 1>, <member 2>, ...)`
private fnbool[] calcFieldOverlap(const scope size_t[] offsets)Calculates whether fields are overlapped based on the passed offsets.
private fnstring invertCompToken(scope string comp) pure nothrow @nogc @safeNegates a comparison token, e.g. `==` is mapped to `!=`
private fnauto assumeFakeAttributes(T)(T t) @trustedCasts the function pointer to include `@safe`, `@nogc`, ...
private fnstring miniFormatFakeAttributes(T)(const scope ref T t)Wrapper for `miniFormat` which assumes that the implementation is `@safe`, `@nogc`, ... s.t. it does not violate the constraints of the function containing the `assert`.
private fnauto pureAlloc(size_t t)Allocates an array of `t` bytes while pretending to be `@safe`, `@nogc`, ...
private fnbool inFinalizer()() pure nothrow @nogc @safeWrapper for GC.inFinalizer that fakes purity

Templates 2

tmpl_d_assert_fail(A...)

Generates rich assert error messages for binary expressions

The binary expression assert(x == y) will be turned into assert(x == y, _d_assert_fail!(typeof(x))("==", x, y)).

Parameters

compComparison operator that was used in the expression.
aLeft hand side operand (can be a tuple).
bRight hand side operand (can be a tuple).

Returns

A string such as "$a $comp $b".
Functions
string _d_assert_fail(B...)( const scope string comp, auto ref const scope A a, auto ref const scope B b) if (B.length != 0 || A.length != 1)
tmplgetPrintfFormat(T)

Yields the appropriate printf format token for a type T