__traits(documentation, X)

Seb seb at wilzba.ch
Wed Jan 17 02:19:11 UTC 2018


What
----

```
/// my fancy string
enum documentedEnum = 1;
enum funcDoc = __traits(documentation, documentedFunc);
assert(funcDoc == "my fancy string")
```

See https://github.com/dlang/dmd/pull/6872 for better examples


Status
-------

The naive implementation leads to a small, but noticeable 
increase of DMD's compilation time.

Andrei's words:

> I'd say keep it on the back burner until we find a couple of 
> good ideas for using it. Discussing it in the forum may help.

So do you have a good use cases for this?
If this is a useful feature, the implementation can be improved 
to be zero-cost for normal runs.

Post here or at https://github.com/dlang/dmd/pull/6872


More information about the Digitalmars-d mailing list