Re:C++17 constexpr everything, or as much as the compiler can
by humanrebar on Thursday December 28, 2017 @10:16AM
(#16022371)
> ...how do you debug it when it only runs at compile time?
I prefer to unit test my constexpr logic with a bunch of static assertions in a cpp file. You could put them in with the code being debugged, but having them separate keeps the header files lighter weight with no real downside assuming you have CI or something set up.
I prefer to unit test my constexpr logic with a bunch of static assertions in a cpp file. You could put them in with the code being debugged, but having them separate keeps the header files lighter weight with no real downside assuming you have CI or something set up.