Expanding CTFE code during compilation
Azi Hassan
azi.hassan at live.fr
Sat Jul 23 18:27:56 UTC 2022
On Saturday, 23 July 2022 at 00:56:39 UTC, Steven Schveighoffer
wrote:
> On 7/22/22 3:22 PM, Azi Hassan wrote:
>
>> 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.
>
> `version(debug)` isn't valid syntax, `debug` is a keyword.
>
> -Steve
I stand corrected, I must've got it confused with
version(unittest)
More information about the Digitalmars-d-learn
mailing list