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,422 of 33,346   
   Dave Harris to Christopher Dearlove   
   Re: std::vector: Surprising order of des   
   24 Jun 12 05:29:52   
   
   From: brangdon@cix.compulink.co.uk   
      
   christopher.dearlove@googlemail.com (Christopher Dearlove) wrote   
   (abridged):   
   > On Monday, June 18, 2012 9:51:40 PM UTC+1, Dave Harris wrote:   
   > > The suggestion is that vector destroy its elements in reverse   
   > > index order. There are no special cases or caveats, no   
   > > restrictions on what vector functions can be called.   
   >   
   > But there are (or would be) restrictions on which vector functions   
   > could be called in order that this corresponded to the order of   
   > construction, reversing that being the reason for it. So in practice   
   > there are restrictions on what vector functions can be called in   
   > order that your proposal has any use. Thus in reality there would be   
   > special cases. (In other words, no restriction on what can be   
   > called. Just restrictions on what can be called and works.)   
      
   If the sequence order is important for correctness, then the   
   programmer would need to keep the order correct. I don't see any   
   special difficulty here. For comparison, if I am using a binary   
   search, and I need to keep the vector sorted, then push_back() is   
   unlikely to do the right thing. Vector provides tools to be used; it   
   is up to the programmer to use them correctly.   
      
   -- Dave Harris, Nottingham, UK.   
      
      
   --   
         [ 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