[Exceptional C++ Style] Item 12: Exception Safety: Is itWort hit?

Ric Parkin ric.parkin at ntlworld.com
Fri Dec 3 05:55:45 EST 2004


From: "Paul Grenyer" <paul at paulgrenyer.co.uk>
> > The partial solution I found was on windows to get the test harness to set
> the structured exception handler so
> > that OS exceptions were turned into test failures, and everything could
> carry on (apart from the possibility
> > that the bug had just written over something important)
> 
> This is what Aeryn does when used with MSVC, but I haven't found a platform
> independent solution yet.

There is none - if your code triggers Undefined Behaviour, then there's no thing that will work everywhere.

The best you can do is do the appropriate specific thing that works.

Hmmm, is one way to have a signal handler and throw an exception from that? I know that's rather naughty, but we're deep into specifics anyway.

Ric




-----------------------------------------
Email provided by http://www.ntlhome.com/





More information about the Effective-cpp mailing list