Question OOP-EXC-0067
HardWhy should C++ exceptions be caught by reference (catch (const std::exception &e))?
- A.
It allows rethrowing only
- B.
It makes them faster to throw
- 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 C++ exceptions be caught by reference (catch (const std::exception &e))?
It allows rethrowing only
It makes them faster to throw
Sign up free to see the answer and a step-by-step explanation.
Catching by value slices derived exceptions and copies them
References are required by the compiler