On Tuesday, 10 June 2014 at 19:36:57 UTC, bearophile wrote:
At about 40.42 in the "Thoughts on static regex" there is written "even compile-time printf would be awesome". There is a patch about __ctWrite in GitHug, it should be fixed and merged.


I wish I'd taken the mic at the end, and 2 days later Adam D. Ruppe said what I was thinking of saying: unit test and debug the CTFE function at runtime and then use it at compile-time when it's ready for production.

Yes, Dmitry brought up compiler bugs. But if you write a compile-time UT and it fails, you'll know it wasn't because of your own code because the run-time ones still pass.

Maybe there's still a place for something more than pragma msg, but I'd definitely advocate for the above at least in the beginning. If anything, easier ways to write compile-time UTs would be, to me, preferable to a compile-time printf.


Reply via email to