Daily bit(e) of C++ | std::abort, std::terminate
Daily bit(e) of C++ #271, Terminating programs using std::abort and std::terminate.
Termination is likely the most sensible reaction when a program reaches an irrecoverable state, notably when invariants are violated.
The standard ways to terminate are std::abort (C) and std::terminate (C++).
Both approaches allow for custom handlers (albeit very limited in the case of std::abort).