dbg

Debug print args followed by a newline.

Similar to Rust's dbg macro introduced in version 1.32.

@safe pure @trusted pure nothrow @nogc
void
dbg
(
Args...
)
(
scope Args args
,
const string file = __FILE_FULL_PATH__
,
const uint line = __LINE__
,
const string fun = __FUNCTION__
)

Examples

int x = 42;
dbg("x: ", x);
static assert(__traits(compiles, { dbg(); })); // ok for dln to discard function qualifiers

See Also

Meta