Closed tkem closed 6 years ago
Turns out <cassert>
is not required for freestanding implementations.
Better than plain assert
would probably be throwing a std::logic_error
.
For systems that don't use exceptions, this could still be wrapped in an #ifndef NDEBUG
block.
Also a RAII-type guard
object should be used to set/clear the processing
flag, to handle exceptions intentionally thrown by actions.
process_event()
must not be called from within an action or guard. Maybe assert this with#ifndef NDEBUG
(flag set on entry and cleared on exit).