Say you have the following destructor in a mutex class wrapping up pthread mutex calls:
~mutex()
{
pthread_mutex_destroy(&m_mutex);
}
If this fails (returns non-zero) we can't throw an exception obviously. How best do we deal with this?
In my opinion, the only sane recourse in such a case is assert(3)
- something went horribly wrong, so somebody has to investigate ...