4 ms·
I recall a C++ book saying something like "ignore it, log an error, or call exit()" to handle an error in a destructor. In other words, there is no correct answ
by blt 11y ago
I recall a C++ book saying something like "ignore it, log an error, or call exit()" to handle an error in a destructor. In other words, there is no correct answer. In practice, the operations usually performed in a destructor are unlikely to fail, and in "typical" programs one of those 3 solutions is probably acceptable. But it's a serious issue in software that is supposed to be 100% robust, i.e. [1].
[1] http://250bpm.com/blog:4 http://250bpm.com/blog:4