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)   
|