[Issue 18422] String members and parameters cannot be mixed in, even during CTFE

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Feb 11 18:40:37 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=18422

--- Comment #2 from Andrei Alexandrescu <andrei at erdani.com> ---
Happy to oblige!

struct Data
{
    string name;
    string type;
    string qualifier;
    string[] attributes;
}

Then the module can give you all top-level data declarations:

enum Data[] d = Module("mypack.mymod").data;
...

Indeed it is odd there'd be functions that only run during compilation. Need to
think of that.

--


More information about the Digitalmars-d-bugs mailing list