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 32,372 of 33,346   
   Dave Abrahams to All   
   Re: Will we ever be able to throw from a   
   05 Jun 12 21:40:01   
   
   From: dave@boostpro.com   
      
   on Tue Jun 05 2012, Thomas Richter  wrote:   
      
   > { Reformatted; please limit your lines to 70 characters -mod/we }   
   >   
   > Am 05.06.2012 11:40, schrieb Zeljko Vrba:   
   >   
   >> I apologize for the wording, but this doesn't make sense.  If you   
   >> throw from the destructor then either   
   >>   
   >> 1) stack unwinding is not in progress, so you can catch the   
   >>     exception and handle the error as usual (isn't the whole point   
   >>     of exceptions that you can ignore WHERE it came from? -- what   
   >>     makes an exception thrown from a dtor different from an   
   >>     exception thrown from a regular method?)   
   >   
   > Can you? What happened with the object under destruction?   
   > Apparently, it is not properly destructed, otherwise there wouldn't   
   > be an exception,   
      
   I think that is a leap of logic.  All we know about what happened is   
   that the destructor emitted an exception and the object's lifetime has   
   ended.   
      
   > yet you have no longer a way of accessing this object and trying a   
   > different clean-up strategy.   
      
   That's true.  But maybe you don't need a different clean-up strategy.   
   It's certainly possible---even easy---to design a class that is "fully   
   destroyed" in every important sense of the phrase even if the   
   destructor throws.   
      
   --   
   Dave Abrahams   
   BoostPro Computing   
   http://www.boostpro.com   
      
      
         [ 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