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,590 of 33,346   
   =?ISO-8859-1?Q?Daniel_Kr=FCgler?= to All   
   Re: std::vector::insert()   
   14 Oct 12 11:34:50   
   
   From: daniel.kruegler@googlemail.com   
      
   Am 14.10.2012 19:18, schrieb Leigh Johnston:   
   [..]   
   > Your rebuttals to his conclusions are incorrect.  You cannot pass   
   > iterators of the same container to insert for the same reason you   
   > cannot pass element references: invalidation on reallocation.   
      
   So far I see no evidence on what you write that proofs my assertion   
   wrong. Keep in mind that several functions can take iterators that may   
   become invalidated during the operation. Among these are all those   
   functions that take an iterator value from the same container as   
   positioning argument, (erase, insert, ...).   
      
   > The (minor) mistake here is the omission of explicitly stating an   
   > extra pre-condition to include element references as well as   
   > iterators but this should be covered elsewhere (invalidation).   
      
   I repeat, the current wording is no oversight. The "omission" exists   
   for good reasons and is intended here. An implementation has to get   
   this right. And I also repeat that for the same reasons the resize   
   function of several containers had been changed for the exact same   
   reason,   
      
   http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#679   
      
   The discussion content exists there for good reason.   
      
   HTH & 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