From: Rik Hemsley Date: 2002-02-25T22:01:53+09:00 Subject: Re: Object/Memory Management #if Sean Middleditch > And what happens when its destructor throws an exception, while you're > already handling an exception, in a list of objects all needing their > destructors called, each of which is likely to throw an additional > exception because of a bad file permission somewhere? C++ FAQs: Q: Should destructors throw exceptions when they fail? A: No. Q: Should destructors call routines that may throw exceptions? A: Only if the destructor catches whatever the routines might throw. Q: Should resource deallocation primitives signal failure by throwing an exception? A: No. > I've found that the majority of applications work best in either very > low-level, fast code (C) or a very high-level, nice OO language (like > Ruby). C++ is an attempt to get a mixture of the two, sacrificing here > and there to try and get the best of both worlds. > > I've found that it tends not to work that nicely. Stick with the fast, > portable C, or make use of a *real* OO language. ~,^ I don't like my apps to fail. Ever. I'm still trying to write a Ruby program that doesn't die in some circumstances due to an exception which I couldn't catch (the situation is better in 1.7, admittedly.) Cheers, Rik