October 16, 2022

I'd like to have:

    version (D_DebugInfo)
    {}
    else
    {
        version = enableFeatureThatIsAnnoyingWhenDebugging;
    }

Is there a way to know if debug info is being emitted when compiling?
"debug is not cutting it because sometimes you really need to debug with or without -debug, and with or without -O. I want -g.

October 17, 2022
There is: D_Optimized

https://dlang.org/spec/version.html#predefined-versions

But nothing for debug info.

I'm afraid I think you'll just have to use a version (unless you want to add it).