There is no reason to believe that runtime is approved here. You should prefer compile-time errors during runtime errors, so there is never a reason, given the option between the two, to choose a runtime statement.
However, if a static statement is not an option (does not know the concept of a static statement, does not know how to make it and does not have one available, or knows how to make it, but doesnβt have time), the statement about the execution time is the next best thing.
With C ++ 0x, the built-in static_assert function should stop all the reasons for using the run-time statement in which the compilation request will run.
source share