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,228 of 33,346   
   Peter Liedermann to francis.glassborow@btinternet.com   
   Re: stl clear and erase.   
   01 May 12 06:35:12   
   
   From: peter09876@hispeed.ch   
      
   On Tue, 01 May 2012 00:41:37 +0200, Francis Glassborow   
    wrote:   
      
   > On 30/04/2012 21:33, Chris Vine wrote:   
   > (...) In general the Standard does not specify how things   
   > should be done only what the resulting behaviour should be.   
   >   
      
   This takes me back to my original question. I have no access to the   
   standard, but as far as I know, it does specify the complexity of   
   operations, and for anyVector.clear() it says O(1) plus whatever   
   destruction is needed.  In the case of vector  anyVector   
   destruction is a no-op (this does not seem to be disputed here).  This   
   would then preclude, in my opinion, iterating over the vector for the   
   purpose of clear()-ing it, and that would not just be an efficiency   
   issue of clever implementation.   
      
   Regards   
   Peter   
      
      
   --   
         [ 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