
26 Mar
2004
26 Mar
'04
4:33 p.m.
Reece Dunn wrote: [snip]
A trick I use when handling HRESULT error codes is to have a class like this (adapted for int error type):
class errorcheck { [snip] public: inline errorcheck( int ec ): error( ec ) { if( ec < 0 ) throw( *this ); }
Careful. Throwing an exception from a constructor means that the object won't be constructed (i. e., does not exist). So you are throwing a non-existing object here. Or am I wrong? Best regards, Klaus