The use of assert instead of runtime conditions for bounds checking doesn't seem like a good idea.
You should probably assert
#ifdef NDEBUG #error #endif
In your source code if your code assumes that assertions will never be disabled.
I assume assert also checks conditions at runtime?
assert(--index >= 0);