If I read the code right, there's no standard way to disable assertions, 
right? Given that this is a rather common functionality in many languages, 
is this something you have explicitly decided not to support (in the 
default implementation)? It would be easy enough to roll my own – but if 
there is good reason not to, then I'd rather not :-)

Whether or not there's a performance hit would depend on how costly your 
assertion expression is, I guess. If, for example, you check some involved 
invariant over a large structure, that's something you might want to 
disable if you were to do a benchmark, for example. (I guess this might be 
an argument for something like a debug flag in general.) This could 
certainly be handled by using a test external to the code for this sort of 
thing, and using assertions only for the minor things. That won't give you 
the same access, though.

Reply via email to