home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / cplus / 11478 < prev    next >
Encoding:
Internet Message Format  |  1992-07-24  |  833 b 

  1. Path: sparky!uunet!utcsri!torn!cunews!nrcnet0!bnrgate!bwdls58!brtph316!chrisf
  2. From: chrisf@brtph316.bnr.ca (Chris Fulmer)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: ||= and &&= operators
  5. Message-ID: <15063@bwdls58.bnr.ca>
  6. Date: 24 Jul 92 15:05:58 GMT
  7. References: <2044@devnull.mpd.tandem.com> <1992Jul12.002723.10300@ucc.su.OZ.AU> <DAVEG.92Jul16005618@synaptx.synaptics.com>
  8. Sender: news@bwdls58.bnr.ca
  9. Reply-To: woodstock!chris@mcnc.org
  10. Distribution: world
  11. Organization: BNR Dept 3B91, RTP
  12. Lines: 16
  13.  
  14. I know I'll get flamed for this because my solution isn't exact, but
  15. what about:
  16.  
  17. &&=  ->  *=
  18. and
  19. ||=  ->  +=
  20.  
  21. Like I said, it isn't exact, but if you're just dealing with boolean
  22. conditions and you don't care about the short-circuiting, you should
  23. be fine.
  24.  
  25. (Yeah, there are other problems:  -1 is TRUE, overflows, etc...)
  26.  
  27. --
  28. Chris
  29.  
  30.