core.internal.dassert
Functions 10
fn
string _d_assert_fail(A)(const scope string op, auto ref const scope A a)Generates rich assert error messages for unary expressionsprivate fn
string 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 fn
string miniFormat(V)(const scope ref V v)Generates a textual representation of `v` without relying on Phobos. The value is formatted as follows:private fn
string formatMembers(V)(const scope ref V v)Formats `v`'s members as `V(<member 1>, <member 2>, ...)`private fn
bool[] calcFieldOverlap(const scope size_t[] offsets)Calculates whether fields are overlapped based on the passed offsets.private fn
string invertCompToken(scope string comp) pure nothrow @nogc @safeNegates a comparison token, e.g. `==` is mapped to `!=`private fn
auto assumeFakeAttributes(T)(T t) @trustedCasts the function pointer to include `@safe`, `@nogc`, ...private fn
string 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 fn
auto pureAlloc(size_t t)Allocates an array of `t` bytes while pretending to be `@safe`, `@nogc`, ...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
comp | Comparison operator that was used in the expression. |
a | Left hand side operand (can be a tuple). |
b | Right 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