home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / cplus / 12740 < prev    next >
Encoding:
Internet Message Format  |  1992-08-21  |  1.4 KB

  1. Path: sparky!uunet!igor!thor!rmartin
  2. From: rmartin@thor.Rational.COM (Bob Martin)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: destruction of temporaries
  5. Message-ID: <rmartin.714434539@thor>
  6. Date: 21 Aug 92 22:02:19 GMT
  7. References: <1992Aug17.073500.24115@ericsson.se> <23466@alice.att.com>     <TMB.92Aug19113657@arolla.idiap.ch>     <1992Aug20.092752.29529@mole-end.matawan.nj.us> <TMB.92Aug21160625@arolla.idiap.ch>
  8. Sender: news@Rational.COM
  9. Lines: 22
  10.  
  11. tmb@arolla.idiap.ch (Thomas M. Breuel) writes:
  12.  
  13.  
  14. |The question is: what should be the default. I don't think that
  15. |mandatory late destruction solves anything, because if you start
  16. |relying on the persistence of temporaries in expressions, the next
  17. |step is that you'll get confused about why they don't hang around for
  18. |the whole block.
  19.  
  20. Agreed.  In my opinion, we should not even have to think about
  21. temporaries.  The compiler should quietly use them in foolproof
  22. situations, and quickly destroy them.  In any situation where a
  23. pointer or reference to a temporary is being taken, the compiler
  24. should complain.  I would not be at all adverse to having the compiler
  25. treat the taking of the address or reference of a temporary as an
  26. error.
  27.  
  28. --
  29. Robert Martin                        Training courses offered in:
  30. R. C. M. Consulting                       Object Oriented Analysis
  31. 2080 Cranbrook Rd.                        Object Oriented Design
  32. Green Oaks, Il 60048 (708) 918-1004       C++
  33.