K
Ken
Hi. I know it is recommended that exceptions should be caught by
reference, but are there recommendations for how an exception should
be thrown? Or is it just a matter of throwing a type that is
compatiple with the catch. If that is the case, I suppose that if you
are catching a reference to exception e, the exception being thrown
better be an instance of e or a reference to an instance of e (ie., if
you threw a pointer to e and caught a reference to e, the compiler
would generate an error).
Thanks for any clarification and/or correction,
Ken
reference, but are there recommendations for how an exception should
be thrown? Or is it just a matter of throwing a type that is
compatiple with the catch. If that is the case, I suppose that if you
are catching a reference to exception e, the exception being thrown
better be an instance of e or a reference to an instance of e (ie., if
you threw a pointer to e and caught a reference to e, the compiler
would generate an error).
Thanks for any clarification and/or correction,
Ken