I found the hard way that assert() in C/C++ exists hard. This post explains that you get a SIGABRT . So, if you want your code to be testable, you better throw an exception instead.
I defined a
LOGIC_ERROR(condition)
macro:
#define LOGIC_ERROR(e) if(!(e)) throw std: