irccd
3.0.3
|
Stack sanity checker. More...
#include <duk.hpp>
Public Member Functions | |
stack_guard (duk_context *ctx, unsigned expected=0) noexcept | |
~stack_guard () noexcept | |
Stack sanity checker.
Instanciate this class where you need to manipulate the Duktape stack outside a Duktape/C function, its destructor will examinate if the stack size matches the user expected size.
When compiled with NDEBUG, this class does nothing.
To use it, just declare an lvalue at the beginning of your function.
|
noexcept |
Create the stack checker.
No-op if NDEBUG is set.
ctx | the context |
expected | the size expected relative to the already existing values |
|
noexcept |
Verify the expected size.
No-op if NDEBUG is set.