Re: still confused


[ Follow Ups ] [ Post Followup ] [ CS328 Message Board ] [ FAQ ]

Posted by Aaron on July 15, 2001 at 23:35:45:

In Reply to: still confused posted by Natalie on July 15, 2001 at 23:11:49:

: I looked in there, and as far as I can tell, only the baz_base class is defined. I am doing something similar to what you have below, and it compiles fine, but then when his foo class tries to throw one of the specific baz error classes (e.g. baz_out_of_memory), I get an error. Anyone else having this problem? Thanks for any help.

Holy inheritance hell... He's made a lot of changes to the baz class since i looked at it last... there is a catchall that you can do, i think it's something to the effect of:
try {}
catch(...) {}
and that will catch any exception that is throw in the try block, but I haven't tried it, although the C++ book I have, by Bjarne says it's valid... if you don't care about the spec. baz's try that, it's better than missing a throw all together and watching a segfault

aaron

: Natalie

: : they are defined in baz.cpp and baz.h, which is in the PROJECT_TWO dir... basically a general catch is good enough unless you are doing some trickery such as evicting things when out of room, or creating a success list... in general, and how I am doing mine until i get a better handle on the bookkeeping, is to do something like this
: : try {
: : // create foo here
: : return success;
: : }
: : catch(baz e)
: : {
: : return failure;
: : }



Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ CS328 Message Board ] [ FAQ ]