On Tuesday, 16 December 2025 at 23:25:18 UTC, DLearner wrote:
1. Any proposals to mark a function as CTFE only?

In OpenD you can

```
string genStuff(string val) {
        if(__ctfe) {
                return val ~ ";";
        } else {
                assert(0);
        }
}
```

That is, wrap the whole function in `if(__ctfe) {}` and it passes this test since the gc use is now provably only in ctfe.

I don't know about the other dmd release but it might work there too, worth trying it.
  • Do string mixins... DLearner via Digitalmars-d-learn
    • Re: Do stri... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
      • Re: Do ... DLearner via Digitalmars-d-learn
        • Re:... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
          • ... DLearner via Digitalmars-d-learn
            • ... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
              • ... DLearner via Digitalmars-d-learn
        • Re:... Adam D. Ruppe via Digitalmars-d-learn
          • ... DLearner via Digitalmars-d-learn
        • Re:... abc via Digitalmars-d-learn
    • Re: Do stri... Kapendev via Digitalmars-d-learn

Reply via email to