On 23/03/2026 6:29 PM, Ada wrote:
On Sunday, 22 March 2026 at 22:49:24 UTC, Richard (Rikki) Andrew Cattermole wrote:
If its a string literal it is already handled as part of bindings: https://dlang.org/spec/pragma.html#printf

I understand that you may be wanting a runtime error, but I'd suggest disallowing that entirely and go with a template parameter to provide your format to make sure its seeable to the compiler.

I clearly said compile-time. maybe you misspoke.
It's a bit of a nuisance because the function call then doesn't resemble C that much anymore. (it's called betterc)

The only way to do it at CT, is either with the pragma with a string literal for the format, or the format must be provided via a template parameter.

You cannot do this, with a function parameter at CT.

  • Compile time for... Ada via Digitalmars-d-learn
    • Re: Compile... Ada via Digitalmars-d-learn
    • Re: Compile... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
      • Re: Com... Ada via Digitalmars-d-learn
        • Re:... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
          • ... Ada via Digitalmars-d-learn
            • ... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
              • ... Ada via Digitalmars-d-learn
                • ... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn

Reply via email to