RE: [boost] Re: boost::execution_monitor impl under windows
by carlos pizano other posts by this author
Sep 21 2003 6:08PM messages near this date
RE: [boost] Re: boost::execution_monitor impl under windows
|
RE: [boost] Re: boost::execution_monitor impl under windows
Dave Abrahams wrote:
> No, I'm disabling the warning with pragmas. The technique works fine.
I don't think so. Well, it can fail. See Carl Daniel post on 9/21. I saw
the thread(s) on comp.lang.c++.moderated about the subject but nobody
mentioned the interaction of the *technique* with /EHs at that time.
Here is where I am going with this. The current way, complied with /EHs
seems to me that can be better done with something along the lines of:
execute()
{
__try
{
try
{
user_function();
}
catch( specific_type1& )
{
report1(text);
}
catch( specific_type2& )
{
report2(text);
}
... other type specific catch(s) here..
... do not put catch(...) here ever..
}
__except ( filter(GetExceptionInformation()) )
{
report_def()
}
} // end of function
/* take the above code at the pseudo-code level */
Now, inside filter() you can do interesting things for instance
re-throwing the SE under certain conditions or checking for the magic
number that says that the SE is really a C++ exception and maybe do your
trick...
Note that the code above will be done in two nested calls since VC does
not
Allow you to mix __try and try on the same function.
There seems to be very little restrictions on what filter() can be, I
wonder
if we can make it dispatch to a virtual function so a derived class can
customize the behaviors.
Think about it.
CPU
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Thread:
carlos pizano
David Abrahams
David Abrahams
Holger Grund
Holger Grund
Holger Grund
Holger Grund
David Abrahams
Carl Daniel
carlos pizano
carlos pizano
David Abrahams
carlos pizano
carlos pizano
carlos pizano
Carl Daniel
Carl Daniel
carlos pizano
|