"Error: `TypeInfo` cannot be used with -betterC" on a CTFE function

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Sun Apr 7 08:59:55 UTC 2024


Unfortunately runtime and CTFE are the same target in the compiler.

So that function is being used for both, and hence uses GC (appending).

```d
template Foo(Args) {
	enum Foo = () {
		return Args.init;
	}();
}
```

Something like that should work instead.


More information about the Digitalmars-d-learn mailing list