
From: Gevorg Voskanyan <v_gevorg@yahoo.com> Artyom wrote:
Mathias Gaunard wrote:
Definitely a no-no. Dereferencing an invalid iterator is a programming error, not an exceptional situation.
The thing to use is an assertion. I'm sorry but as far as I remember nobody deprecated std::logic_error (and std::out_of_range derived from it).
Small point, when you program some mission critical systems and services you don't want the process to go down for something that maybe only a single response can go down that way. This is very important for some mission critical code (and I had written such code not once).
For that reason one can specify a different behavior for BOOST_ASSERT to invoke
when it fails - throw std::logic_error, log somewhere, whatever. [snip]
Didn't know this, if so this is very good. If so I'll fix it this way BOOST_ASSERT. Artyom