On Thursday, 4 April 2024 at 14:06:19 UTC, Richard (Rikki) Andrew Cattermole wrote:

```d
static assert(0, "message");
```

Or if it is known to be CTFE'd

```d
assert(0, "message");
```

Just a warning, its a one time use only for both.

No other way to do it.

That's ... unfortunate.

Some search of the forum led me to some [decade plus old discussion](https://forum.dlang.org/post/j1n1m2$24p0$1...@digitalmars.com) of a possible CTFE writeln function that would be a no-op at runtime, which to my surprise led me to find [core_builtins.__ctfeWrite](https://dlang.org/phobos/core_builtins.html#.__ctfeWrite) but when I tried it out, it compiled yet output no text to the console. Given your remarks I suppose I should have expected this.
  • Re: CTFE write m... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
    • Re: CTFE wr... Carl Sturtivant via Digitalmars-d-learn
      • Re: CTF... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
        • Re:... Carl Sturtivant via Digitalmars-d-learn
          • ... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
            • ... Carl Sturtivant via Digitalmars-d-learn
            • ... Salih Dincer via Digitalmars-d-learn
          • ... Paolo Invernizzi via Digitalmars-d-learn
            • ... Carl Sturtivant via Digitalmars-d-learn
              • ... Salih Dincer via Digitalmars-d-learn

Reply via email to