I\'ve wrote several constexpr functions and use them in static_asserts to control some resource limits. But I\'d like to not only enforce compile-time predicate but also to
With most recent GCC compilers (g++
, in 2020 GCC 9 at least) on at least Linux systems (and probably others) you could develop your GCC plugin adding your __builtin_compile_time_print
to the existing GCC builtin functions. Or add your own #pragma
or _Pragma
having a similar side effect.
I started working (with European H2020 funding from CHARIOT) on the Clips-rules-gcc project. Probably in 2 or 3 months you might be able to use it to do what you want. Please stay tuned.
See also my obsolete GCC MELT project, which could have enabled you to do what you want with some obsolete 4.6 GCC compiler.
Of course you could patch Clang/GCC to do similar things.