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 33,145 of 33,346   
   =?windows-1252?Q?Daniel_Kr=FCgler?= to All   
   Re: input iterators and post increment   
   24 Jul 13 23:54:01   
   
   From: daniel.kruegler@googlemail.com   
      
   On 2013-07-25 01:04, Daniel Krügler wrote:   
   > Am 24.07.2013 20:40, schrieb Edward Diener:   
   >> Would you please cite in the C++ standard where it says that a copy of   
   >> the previous value is invalidated ?   
   >   
   > See Table 107 — Input iterator requirements, post-conditions of the   
   > expression "++r":   
   >   
   > "any copies of the previous value of r are no longer required either to   
   > be dereferenceable or to be in the domain of ==."   
   >   
   > While this doesn't strictly say that these values are "invalidated", the   
   > wording has de-facto this effect (and it is intended).   
      
   One follow-up to this: The current wording basically means that all   
   copies of a given iterator may reference the same underlying data source   
   (such as an input stream). Now if e.g. one copy increments this   
   underlying data source, the effect is that the incrementation has   
   happened for all copies.   
      
   Such design is not possible for other iterators, because all copies must   
   behave like independent entities.   
      
   Of-course what I said is only relevant for operations that are part of   
   the iterator operations. It is still possible to have valid forward   
   iterators - or even "higher" iterator categories - that share common   
   data, but this sharing must not have observable effects that would   
   conflict with the corresponding iterator requirements.   
      
   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