title: Try Catch Block Creating an Object
body: <p>So for a class I am taking, we are getting practice with overloaded operators but more specifically we are designing a class for fractions(rational numbers). I am playing around with try-catch blocks and can't seem to get it to work like I want nor can I find any forums or articles on what I can't figure out. I'm trying to create the rational number object in a try-catch block to make sure that the value being put into the denominator is not a '0' and if it is, I let the catch block call the deconstructor for the object. I got this bit to work just fine but it seems that there is no way for me to use the object being created within the try-catch block later on in the code even if the constructor succeeded in assigning a non-zero value to the denominator. Is there a way to declare an object within a try-catch block to verify it won't throw an exception in its creation but still have it within the scope of the rest of the code that is outside the try-catch block but still in the same function or is there no way to pull it off?</p>