home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / cplus / 12734 < prev    next >
Encoding:
Text File  |  1992-08-21  |  1.4 KB  |  38 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!cs.utexas.edu!sdd.hp.com!usc!rpi!batcomputer!munnari.oz.au!cs.mu.OZ.AU!mundil.cs.mu.OZ.AU!fjh
  3. From: fjh@mundil.cs.mu.OZ.AU (Fergus James HENDERSON)
  4. Subject: Re: destruction of temporaries
  5. Message-ID: <9223502.26462@mulga.cs.mu.OZ.AU>
  6. Sender: news@cs.mu.OZ.AU
  7. Organization: Computer Science, University of Melbourne, Australia
  8. References: <BszApE.49v@world.std.com> <1992Aug17.073500.24115@ericsson.se>     <23466@alice.att.com> <3920@starlab.UUCP> <23487@alice.att.com>     <TMB.92Aug20142610@arolla.idiap.ch> <23507@alice.att.com> <TMB.92Aug21142555@arolla.idiap.ch>
  9. Date: Fri, 21 Aug 1992 16:58:13 GMT
  10. Lines: 26
  11.  
  12. tmb@arolla.idiap.ch (Thomas M. Breuel) writes:
  13.  
  14. >In article <23507@alice.att.com> ark@alice.att.com (Andrew Koenig) writes:
  15. >
  16. >   The trouble comes with expressions like
  17. >
  18. >       foo().bar().baz()
  19. >
  20. >   where bar returns *this. If an implementation is allowed to delete
  21. >   the result of foo() before calling baz, the roof can cave in even
  22. >   if your defensive rules are followed.
  23. >
  24. >Read my paragraph again. I explicitly stated you shouldn't return a
  25. >reference to "*this".
  26.  
  27. What about
  28.  
  29.     cout << "Hello World" << endl;
  30.  
  31. Does this mean that we have to go back to printf?
  32.  
  33. -- 
  34. Fergus Henderson             fjh@munta.cs.mu.OZ.AU      
  35. This .signature VIRUS is a self-referential statement that is true - but 
  36. you will only be able to consistently believe it if you copy it to your own
  37. .signature file!
  38.