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,370 of 33,346   
   Dave Abrahams to All   
   Re: Will we ever be able to throw from a   
   05 Jun 12 21:35:17   
   
   From: dave@boostpro.com   
      
   on Tue Jun 05 2012, Wil Evers  wrote:   
      
   > Dave Abrahams wrote:   
   >   
   >> So in your view, there is a substantial difference between:   
   >>   
   >>    struct C { C(){throw 1;} };   
   >>    void f()   
   >>    {   
   >>        C x;   
   >>        ...   
   >>    }   
   >>   
   >> and   
   >>   
   >>    struct D { ~D(){throw 1;} };   
   >>    void f()   
   >>    {   
   >>        {D x;}   
   >>        ...   
   >>    }   
   >>   
   >> in terms of their meaningfulness or handle-ability?  I'd be   
   >> interested in your explanation, if so.  It seems to me that as the   
   >> user of f(), I don't care whether the exception came from C's   
   >> constructor or D's destructor.   
   >   
   > In C++11, in the first example, an exception will escape from f(),   
   > while in the second example, the terminate handler gets called.  To   
   > me, that sounds like a pretty substantial difference.   
      
   I think you are mistaken.  Both programs have the same behavior.   
      
   --   
   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