CTFE write message to console

Richard (Rikki) Andrew Cattermole richard at cattermole.co.nz
Thu Apr 4 14:06:19 UTC 2024


On 05/04/2024 2:54 AM, Carl Sturtivant wrote:
> I'm writing CTFE on Windows, latest DMD compiler. How should I write a 
> message to the console (stderr) from a CTFE function call during 
> compilation?

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


More information about the Digitalmars-d-learn mailing list