T
Tobias Müller
Rui Maciel said:Equivalent means having the same effect, and assertions are used to assert
that a specific condition is met. Knowing this, if you wish to assert that
a given condition is met, and that condition is expressed through a constant
condition, then, whether you employ
assert( ("message",condition))
...or
static_assert(condition, "message)
...you still get to determine if a condition has been met. That is, you
still get the same effect from either option. Hence, in the case under
consideration, they are equivalent.
I'm sure you are aware that, in this context, you are nit-picking. I'm sure
you are quite able to come up with a scenario where both would be
equivalent, that is, both would have the same effect.
If you read it I'm sure you will understand.
Rui Maciel
The important property of static_assert is, that it triggers at compile
time, the additional message is just nice to have.
So essentially they have a very different _effect_, they just _look_
similar.
Tobi