On 08/25/2012 02:15 AM, bearophile wrote:
cal:

I saw something on the forum not too long ago about statically
checking to see if the current function is being executed at compile
time, but can't seem to find it now. Can it be done? (Like static if
(__ctfe__) or something)

It's named __ctfe, but unfortunately it's an (immutable) run-time value.
When you use it you rely on the dead code elimination optimization done
by the compiler.

Bye,
bearophile

Which is basically guaranteed to be performed.


Reply via email to