printf() metaprogramming challenge
Petar
Petar
Fri May 24 12:14:09 UTC 2019
On Friday, 24 May 2019 at 09:52:58 UTC, Radu wrote:
>
> Yes, good point! I forgot about this trick.
Best verified on d.godbolt.org. Compare:
* https://d.godbolt.org/z/E8aoBg - compiles without -betterC,
generates a ton of bloat
* https://d.godbolt.org/z/GGh9c1 - same, but doesn't compile with
-betterC
* https://d.godbolt.org/z/mPQMcc - compiles with -betterC
*
https://run.dlang.io/gist/run-dlang/1caf15c8c7dded16ba812353361feda9 - what I would like to write, but currently produces too much bloat and doesn't work with -betterC
The examples above, were inspired by
https://twitter.com/Cor3ntin/status/1127210941718962177. I wanted
to check how D with -betterC would compare to C++23+ w.r.t code
gen (bloat).
More information about the Digitalmars-d
mailing list