
Christian Holmquist wrote:
On 14 October 2011 12:55, Dave Abrahams <dave@boostpro.com> wrote:
Is throwing an exception going to turn an incorrect program into a correct one?
I'm probably completely misunderstanding your point of view, or rather, what is your point of view?
He's saying that if a program does a push_back when the capacity has been reached, this program has a logic error, and throwing an exception will not make the error go away. I'm not so sure of that, because doing a push_back when the capacity has been reached is not necessarily a logic error if the code is well aware of the possibility and prepared to handle the exception. try { do some push_backs into a static_vector; we don't know how many } catch( out_of_capacity& ) { // ignore, what we gathered so far is good enough for gov't use }