trace - multiple declarations

Template trace

Debugging aid: Output current file/line to stderr.

template trace ;

Also flushes stderr to ensure buffering and a subsequent crash don't cause the message to get lost.

Contained Functions

NameDescription
trace

Example

// Output example:
// src/myproj/myfile.d(42): trace
trace();

Template trace

Debugging aid: Output variable name/value and file/line info to stderr.

template trace(alias var) ;

Also flushes stderr to ensure buffering and a subsequent crash don't cause the message to get lost.

Contained Functions

NameDescription
trace

Example

auto x = 5;
auto str = "Hello";

// Output example:
// src/myproj/myfile.d(42): x: 5
// src/myproj/myfile.d(43): str: Hello
trace!x;
trace!str;