-debug question

Steven Schveighoffer schveiguy at gmail.com
Fri Jan 21 02:10:34 UTC 2022


On 1/20/22 9:07 PM, forkit wrote:
> I have a line of code, that I do NOT want executed when -debug is passed 
> in.
> 
> enforce(!exists(fname), "Oop! That file already exists!");
> 
> Is this even possible? (with using -version ..)
> 

`debug` is like a `version` block.

```d
debug {} else {
   // code that runs when -debug is not present
}
```

-Steve


More information about the Digitalmars-d-learn mailing list