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,381 of 33,346   
   =?UTF-8?B?RGFuaWVsIEtyw7xnbGVy?= to All   
   Re: std::vector: Surprising order of des   
   07 Jun 12 12:01:31   
   
   From: daniel.kruegler@googlemail.com   
      
   Am 07.06.2012 19:40, schrieb Volker Lukas:   
   > Daniel Krügler wrote:   
   >   
   >> On 2012-05-31 06:20, PiotrN wrote:   
   >>> I am curious is there any C++ standard rules about destruction of   
   >>> std::vector elements.   
   >>   
   >> The standard does not specify the order of destruction of the   
   >> elements. Neither does it do so for clear(), resize(), and other   
   >> member functions that would destroy any element.   
   > For vector resize it does specify "backwards" order, because erasing   
   > must happen by calling pop_back as many times as necessary to shrink the   
   > vector to its new size, if new size is lesser than old.   
      
   This is an important observation, but I can ensure you, that this   
   wording change was *not* done to specify a specific order of destruction   
   for std::vector, but is was done to fix a problem with the previous   
   wording defined in terms of erase() as described in   
      
   http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2033   
      
   bullet 4 of the issue description.   
      
   This looks like an unwanted side-effect of the issue and I think a new   
   issue is in order.   
      
   Greetings from Bremen,   
      
   Daniel Krügler   
      
      
   --   
         [ 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