Question OOP-EXC-0017
HardWhy should destructors in C++ not throw exceptions?
- A.
The compiler forbids throw anywhere in a class
- B.
Throwing is slower in destructors
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Exception Handling question
Why should destructors in C++ not throw exceptions?
The compiler forbids throw anywhere in a class
Throwing is slower in destructors
Sign up free to see the answer and a step-by-step explanation.
If a destructor throws during stack unwinding from another exception, std::terminate is called
Destructors can't contain code