Alias Quirks

Swiss army knife for getting information about things.

alias Quirks(alias thing_) = value;

Takes thing and tries to apply a list of functions and templates to it. All that compile can be accessed using property syntax on the resulting alias.

The code for this is generated during compile-time using traits and mixins. Below is a list of properties that are possible to access (note not all will be available for every instantiation):

In addition, the following properties that require a template parameter are also available:

Example

struct S {
    static long id;
    int age;
    static string name() {
        return "name";
    }
    void update(bool force) { }
}

Quirks!S.type; // S
Quirks!S.fields.length; // 2
Quirks!S.methods[1].name; //update
Quirks!S.isArray; // false
Quirks!S.methods[1].parameters[0].type; // bool