is there a way to display a compile time integral constant during compilation?
I tried to use static_assert() but it expects a string literal and even though I programmed a compile time conversion of int into a char array I cannot display the result in static_assert() because it expects a string literal. So maybe if we generate an error we will produce the integer value... But I need the value to appear every time some condition is true (its a recursive algorithm), from the first down to 1.
visual studio has some clever pragma (#define / macros built into the IDE) commands but I don't think this is possible even with those. The value isn't really going to be known at compile time for the recursive calls because the compiler may not be evaluating the calls when it renders code.
In the off chance that it is tail-recursion or in a format that the compiler is able to convert it internally to tail (and therefore to a loop) AND it chooses to unroll the loop if might be possible for that special setup. This is very unlikely because unrolling requires a fixed # of iterations, I think.
There may be a way to re-write the code to do it, depending on what it actually is, but I expect that will either also be impossible or will be too clunky to do if you attempt to force it, depends on what the algorithm really does.