How does the default catch statement catch(...) {} catch an exception, by value or by reference?
Secondly, how does the default throw throw; throw an exception, by value or by reference?
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.
The catch-all catch
(...)doesn’t give you access to the exception object at all, so the question is moot. [Corrected:] Rethrowing withthrow;throws the original object. If the handler catches by value, then changes to the local copy do not affect the original, rethrown object.[/] See 15.3 (esp. clause 17) for details.Check out some of the related questions on the right, like this one or this one and this one and this one.