[studxml-users] Asserts in next_expect functions

Boris Kolpackov boris at codesynthesis.com
Thu Oct 19 13:40:28 EDT 2017


Pedro Calixto <pedro at kryptus.com> writes:

> There is a difference, however, between these assertion placements.

The assertion checks the function pre-condition which is that it should
only be called for start_element events. To put it another way, if the
assertion is triggered, then the code that called next_expect() is
invalid. If the exception is thrown, then the XML provided by the
user is invalid. In most cases you want to find out that your code
is broken as soon as possible.

Boris



More information about the studxml-users mailing list