Negative

Stewart Gordon smjg_1998 at yahoo.com
Wed Mar 1 06:07:28 PST 2006


Don Clugston wrote:
<snip>
> Is the convoluted nature of the RAII solution simply because
> the same destructor is executed regardless of whether the function was 
> exited normally, or whether an exception occurred? And because there's 
> no easy way of determining if you are inside an exception handler. So 
> you only have "finally", without "catch".
> I wonder if destructors could be jazzed up, so that they can insert an 
> "on_scope_failure" as well as "on_scope_exit"?
> Maybe called ~catch()?
<snip>

Can you think of a practical use for this idea?  I'm not sure what sense 
it would make, considering that the class knows nothing of what the code 
that failed was doing at the time.

Stewart.

-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/M d- s:- C++@ a->--- UB@ P+ L E@ W++@ N+++ o K-@ w++@ O? M V? PS- 
PE- Y? PGP- t- 5? X? R b DI? D G e++>++++ h-- r-- !y
------END GEEK CODE BLOCK------

My e-mail is valid but not my primary mailbox.  Please keep replies on 
the 'group where everyone may benefit.



More information about the Digitalmars-d mailing list