Monday, September 6, 2010


The following Exception Classes are related as follows:
A logic_error is a domain_error. A runtime_error is a range_error.

Reference: The C++ Standard Library by Nicolai M. Josuttis. Addison-Wesley, 1999, p. 26.

A way to remember this:
It is a logic_error for providing bad input (domain) to an object.
During an object's runtime, something might go out of range.
(It's just a mnemonic)

No comments:

Post a Comment