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,018 of 33,346   
   Zeljko Vrba to red floyd   
   Re: why not implicit operator !=()?   
   16 Mar 12 06:31:43   
   
   From: mordor.nospam@fly.srk.fer.hr   
      
   On 2012-03-15, red floyd  wrote:   
   >   
   > To be honest, that would probably be bad form, and horrendous to read,   
   > but it's perfectly legal to do so.   
   >   
   Using << for stream output is, IMO, bad form too, and was an extremely   
   bad idea   
   when streams were designed.  The notation is severely misleading as it   
   implies   
   sequencing where there is none.  I have been bitten numerous times by   
   something   
   looking as innocuous as   
      
   cout << a() << b() << endl;   
      
   but where a and b had some side-effects.  This looks like sequencing,   
   but is in   
   actuality a series of function calls with unspecified order of   
   evaluation with   
   no sequence point in between.  Bad notation indeed.   
      
   This   
      
   cout , a() , b() , endl;   
      
   looks possibly a bit uglier, but it would ensure proper sequencing.   
      
   [Hmm: would it? Is user-defined comma still a sequence point?]   
      
      
   --   
         [ 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