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.
I'm making a modification to a D binding for a C library. I made
a CTFE function which takes a function declaration with one or
more `const(char)*` or `char*` parameters and makes an overload
that accepts D strings. While this function is only used during
compile time, unfortunately, I have
On Sunday, 24 March 2024 at 07:41:41 UTC, Dom DiSc wrote:
I'm creating a library that is completely pure, but it doesn't
compile with pure: at the top because of one impure unittest
(which uses random to test some things only probabilistic)!
So do I really need to declare every function pure
On Sunday, 7 April 2024 at 08:59:55 UTC, Richard (Rikki) Andrew
Cattermole wrote:
Unfortunately runtime and CTFE are the same target in the
compiler.
:-(
Will this ever be changed?
```d
template Foo(Args) {
enum Foo = () {
return Args.init;
}();
}
```