Re: Writing exception-safe code

Dear mate

Yes a very important topic indeed… I remember Herb Sutter classifying exception safety as

1. Basic exception safety
This makes sure that when you throw, stack unwinding releases resources.

2. Strong exception safety - this is hard ( make sure that the system somehow backtracks to a sane state after an exception happens )…

The idioms of throwing exception within constructors should also be mentioned… ( the rule that destructor is not invoked but  objects within this objects are destroyed - this is one reason for going from built in pointers to auto_ptrs and friends ).
– cheerio atul

Would you like to post a relpy?


This post is a reply to:
Writing exception-safe code
Dear all, I think we’ve shortly discussed these topics here already but never reached a point where we decided how we do stuff in Calitko. I remember saying that I’ve never (more...)

Follow-ups:
Re: Writing exception-safe code
Hi Atul, thanks for the follow-up! I think that strong exception safety is what we should be aiming at. It would be hard and would require training and lots of (more...)