
"AlisdairM" <alisdair.meredith@uk.renaultf1.com> writes:
David Abrahams wrote:
std::runtime_error loses meaning pretty quickly when you look at it closely, since everything reported by an exception is a runtime error, by definition :)
IIUC though, there remains a distinction between std::runtime_error and std::logic_error. The former is intended to report exceptional conditions that cannot be detected until runtime, such as losing a network connection halfway through a read. The latter is for conditions that can (potentially) be avoided by better coding, such as failing consistency checks and dividing by zero, where the violating arguments can be detected and re-routed up front.
And the latter should almost never be used :). IMO standardizing a logic_error exception was a big mistake. -- Dave Abrahams Boost Consulting www.boost-consulting.com