Liste des Groupes | Revenir à cl c++ |
Paavo Helde writes:If an exception has reached the top-level catch, then this means that all lower levels (which have more knowledge about the context) have not been able to catch and handle it. In the top-level catch there is little hope I could do anything smarter, typically I just need to report or log an error message.
>Sure, catch(...) deals with it. But it gives you nothing useful to work with. A valiant attempt to send a bat-signal to std::current_exception will eke out a few useful bits, if one's lucky, but the end result will just be more spaghetti code.
Anyway, avoiding uncaught exceptions is easy, one just has to place catch(...) in main() and in all thread functions. Problem solved.
I dunno, maybe something like:That's the first good idea from you in this discussion. I still do not see much point in exception specifications, but such a typedef would at least make life easier for me on this Alternate Earth.
typedef throws(ClassA, ClassB) AlgoThrownClasses;
Then you go ahead and declare your algorithm:
void my_algorithm(algorithm_info_t &) throws(AlgoThrownClasses)
Les messages affichés proviennent d'usenet.