```d
struct S {
    int field0;
    int* field1, field2;
}

void main() {
    import std.stdio;
    S input;
    input.field1 = new int(2);

    foreach(v; input.tupleof) {
        write(__traits(identifier, v), " = ");

        static if (is(typeof(v) : T*, T)) {
            if (v is null)
                writeln("null");
            else
                writeln(*v);
        } else {
            writeln(v);
        }
    }
}
```
  • Printing struct ... z via Digitalmars-d-learn
    • Re: Printin... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn

Reply via email to