John Regehr on "Use of Assertions"
Ola Fosheim Grøstad
ola.fosheim.grostad at gmail.com
Sun Sep 9 09:26:55 UTC 2018
On Sunday, 9 September 2018 at 06:27:52 UTC, Jonathan M Davis
wrote:
> So, maybe what we should do here is take a page from Weka's
> playbook and add a function that does something like check a
> condition and then assert(0) if it's false and not try to say
> that assertions should always be left in production.
That's the easy solution, but in real world development things
get more complicated. Say, if you develop a game maybe you want
no asserts in your render code, but as many asserts as possible
in your game logic code...
It would make sense to defer some way of control to the calling
context. Especially with templated functions in a very generic
library that is used across the entire program.
More information about the Digitalmars-d
mailing list