Expanding CTFE code during compilation

Dennis dkorpel at gmail.com
Tue Jul 19 22:27:56 UTC 2022


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
```


More information about the Digitalmars-d-learn mailing list