This question is inspired by this post: reason for memory leakage in C C++
What are the other kind for problem that can arise because of using exceptions?
I mean what are the problems that we should keep in mind while using exception handling
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Bjarne Stroustrup has made the chapter on exception safety (The C++ Programming Language, 3rd ed.) available.
Additionally you have to make sure that exceptions interrupting your functions mid-call will be harmless. If you use RAII (the generally recommended approach) to automatically release mutexes, for instance, you could get halfway through an atomic operation (money withdrawn from bank account 1), throw an exception, and leave the system in an inappropriate state (money not yet deposited to bank account 2).
The somewhat classic ScopeGuard article has additional information.