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,314 of 33,346   
   Johannes Schaub to All   
   Re: postfix operator++   
   18 May 12 17:23:05   
   
   1095fec3   
   From: schaub.johannes@googlemail.com   
      
   Am 18.05.2012 23:11, schrieb Anand Hariharan:   
   > On May 17, 1:34 pm, Johannes Schaub   
   > wrote:   
   >> A comparison with a similar construct: If you change "x++" to "++x",   
   >> the behavior becomes defined in C++11:   
   >>   
   >>        int x = 10;   
   >>        x = ++x;   
   >>   
   >> Now there is an intuitive "dependency" on the result of "++x" and the   
   >> variable "x":   
   >   
   > Even when restricting this to the "intuitive" level, there is still a   
   > sequencing issue that the instruction to store the incremented value   
   > of x in x and the instruction to store the result of assignment in x   
   > have no relative ordering.   
   >   
      
   I agree to you. I wanted to make the reader aware that the compiler has   
   a sense of knowing that the right hand side of the assignment still   
   refers to x, so that it can be more cautious in sequencing these two   
   side effects (even when there would be no formal guarantees by C++11,   
   but indeed there are guarantees that make it valid). I guess this wasn't   
   a good example :)   
      
   > I would appreciate a reference (or a pointer or ... -- pun intended,   
   > of course) to a writeup about what the new C++ language standard has   
   > changed regarding sequence points -- that is (1) targeted to an   
   > audience of ordinary mortals and (2) authored by someone who is   
   > considered authoritative on the subject (*).   
   >   
   > thank you,   
   > - Anand   
   >   
   > (*) No, Johannes -- I am NOT implying you are not knowledgeable.  What   
   > I mean is, I don't want URLs to some discussion form in some web forum   
   > just because a bunch of people clicked the "Like" or "+1" button.   
   >   
   >   
      
   Thanks for your caution, but I'm aware that I'm far from being   
   authorative on this subject. But just enough to answer this question. I   
   don't understand your discomfort with StackOverflow regarding this   
   though; if there is someone authorative who posts there and people +1 or   
   "Like" it, why do you not want an URL to it? There have been posts by   
   Herb, Anthony, Stroustrup, Howard and others on that site. This one is   
   by Anthony and concerns this subject:   
   http://stackoverflow.com/a/9581666/34509   
      
      
   --   
         [ 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