P
Paul Dubuc
Phlip said:You can catch(...) { cleanup; throw; }
But you must also call cleanup at normal function exit. However...
If I have class Q that requires Q::cleanup(), then all methods that use Q
must call cleanup(). That couples Q's internal state (the fact that it
isn't clean yet) to the control flow of all its methods. That is wasteful.
See also:
http://www.informit.com/guides/content.asp?g=cplusplus&SeqNum=189&rl=1