printObjects

Prints out aggregate objects, with all their printable members with all their printable values.

This is not only convenient for debugging but also usable to print out current settings and state, where such is kept in structs.

@trusted
void
printObjects
(
Flag!"all" all = No.all
Things...
)
(
auto ref Things things
)
if (
(Things.length > 0) &&
allSatisfy!(isAggregateType, Things)
)

Parameters

all

Whether or not to also display members marked as Unserialisable; usually transitive information that doesn't carry between program runs. Also those annotated Hidden.

things Things

Variadic list of aggregate objects to enumerate.

Examples

struct Foo
{
    int foo;
    string bar;
    float f;
    double d;
}

Foo foo, bar;
printObjects(foo, bar);

Meta