In C++, in the exception declaration specifier, if I declare a base class and then throw a derived class, is that an unexpected exception?
Share
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.
No. It is allowed.
Reference:
C++03 15.4 Exception specifications
Para 6:
There is a relevant example in
Para 8:
Note that Exception specifications are considered as an experiment that failed and most compilers do not implement them correctly. So avoid(rather don’t) use them.