When exactly would a bad_typeid exception be used?
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.
This type of exception generally wouldn’t be used. Instead, it only exists so that you can recognize it. If a tester or user sends you a crash report that mentions
bad_typeid, you’ll know what sort of bug to look for when you start debugging.You’re not really meant to throw this exception yourself, and I don’t think you’re even meant to catch it, either. After all, what could you possibly do to resolve the root cause of this error within your program? The way to recover from this type of exception is to find the bug, fix it, recompile, and distribute an updated version of your program that doesn’t attempt to use the
typeidoperator on invalid values.