23 Jan
2018
23 Jan
'18
10:13 p.m.
On Tue, Jan 23, 2018 at 1:25 PM, Niall Douglas via Boost < boost@lists.boost.org> wrote:
I have a question, who throws exceptions to indicate logic errors?
There's a sizeable number of people who are very keen on doing so. Hence std::logic_error and family i.e. WG21 historically has agreed.
It is unreasonable to think that a program that has just encountered a logic error can recover gracefully from it any more it can do so from a crash. Try to recover, and you might make things worse, possibly much worse.
I'd now go so far as to assert - not even claim - that if you're throwing logic-error-type-exceptions in brand new C++ 14 or 17 library code, you're doing something very wrong.
Yes indeed. Emil