home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c++.moderated      Moderated discussion of C++ superhackery      33,346 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 33,188 of 33,346   
   Rupert Swarbrick to DeMarcus   
   Re: RAII advice (for a RAII newbie)   
   02 Sep 13 06:36:09   
   
   From: rswarbrick@googlemail.com   
      
   DeMarcus  writes:   
   > [*] You should be very careful with catching ellipsis (...). If you do   
   > you must at least rethrow, like this:   
   >   
   > catch (...)   
   > {   
   >     cleanup();   
   >     throw;   
   > }   
   >   
   > (I challenge anyone reading this to come up with examples where one   
   > would ever need to catch ellipsis)   
      
   I think I have one: to implement the task group functionality described   
   in the recent N3711. Quoting from them:   
      
     If any of the tasks throws an exception, ~task_group invokes the   
     ExceptionHandler with the exception_list containing the   
     std::exception_ptr objects that represent all the exceptions thrown by   
     the tasks spawned by the run method.   
      
   I haven't read their prototype implementation, so maybe they only catch   
   children of std::exception, but implementing something like this is   
   probably a use case.   
      
   Rupert   
      
      
   --   
         [ See http://www.gotw.ca/resources/clcm.htm for info about ]   
         [ comp.lang.c++.moderated.    First time posters: Do this! ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca