As a newbie in D (and making a lots of mistakes), I've found myself relying heavily in the use of a rudimentary type inspector to visualize my templated code instantiations. It's simple and incomplete as hell but good enough to see what happens under the hood quickly.

QUESTION: Is there a function like that already in D?


//real-life example
goodEnoughTypeInspector!Human;
goodEnoughTypeInspector!(Database!Human);

//compile-time output
Inspecting type: Human
         - public string name
         - public string address
         - public bool active

Inspecting type: Database!(Human)
         - private string[] name
         - private string[] address
         - private bool[] active
         - public pure nothrow @nogc @safe ulong() count
         - public void insert


Reply via email to