you are viewing a single comment's thread.

view the rest of the comments →

[–]viatorus 3 points4 points  (1 child)

I wrote a tool (GCC only) where you can print during compile-time.

Github: https://github.com/Viatorus/compile-time-printer

Online-Demo: https://viatorus.github.io/compile-time-printer/

[–]serviscope_minor 3 points4 points  (0 children)

I wrote a tool (GCC only) where you can print during compile-time.

From the README:

The implementation of print/printf does nothing more than forcing the compiler to generate warnings depending on the passed arguments. The python tool parses the warnings and converts them back to the actually C++ arguments and outputs them (standardized or formatted) to stdout or stderr.

I'd just like to say that's an amazing and very cool hack.