Expanding CTFE code during compilation

Azi Hassan azi.hassan at live.fr
Wed Jul 20 00:33:06 UTC 2022


On Tuesday, 19 July 2022 at 22:27:56 UTC, Dennis wrote:
> On Tuesday, 19 July 2022 at 21:43:01 UTC, Azi Hassan wrote:
>> I'm wondering if the offers has the option of executing the 
>> parts that can be evaluated at compile time and then replacing 
>> them with the result of this evaluation.
>
> Try the `-vcg-ast` flag:
> ```D
> import object;
> import std;
> void main()
> {
> 	enum int x = 24;
> 	writeln(24);
> 	return 0;
> }
>
> // ... and a bunch of template instances
> ```

Thanks a lot, this is exactly what I had in mind. Where did you 
find it though ? I checked dmd --help and man dmd before making 
this thread, but to no avail.


More information about the Digitalmars-d-learn mailing list