Expanding CTFE code during compilation

Azi Hassan azi.hassan at live.fr
Fri Jul 22 19:22:59 UTC 2022


On Wednesday, 20 July 2022 at 01:15:44 UTC, Steven Schveighoffer 
wrote:
> On 7/19/22 8:57 PM, Steven Schveighoffer wrote:
>
>> There's a slight bloat in the compiler symbol table when  but 
>> other than that it should be effective.
>
> Obviously I didn't finish that thought...
>
> "when `-debug` isn't used on the command line"
>
> -Steve

Oh, interesting syntax. I was thinking something along the lines 
of

```D
template printEnum(...) {
     version(debug) {
         ... // everything we already did
     } else {
         enum printEnum(alias x) = x;
     }
}
```

But I like yours better.


More information about the Digitalmars-d-learn mailing list