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

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!mole-end!mat
  3. From: mat@mole-end.matawan.nj.us
  4. Subject: Re: destruction of temporaries
  5. Message-ID: <1992Aug20.092752.29529@mole-end.matawan.nj.us>
  6. Summary: operator void() ???
  7. Organization: :
  8. References: <1992Aug17.073500.24115@ericsson.se> <23466@alice.att.com> <TMB.92Aug19113657@arolla.idiap.ch>
  9. Date: Thu, 20 Aug 1992 09:27:52 GMT
  10. Lines: 30
  11.  
  12. In article <TMB.92Aug19113657@arolla.idiap.ch>, tmb@arolla.idiap.ch (Thomas M. Breuel) writes:
  13. > In article <1992Aug18.205211.16789@Warren.MENTORG.COM> adk@Warren.MENTORG.COM (Ajay Kamdar) writes:
  14. >    So why would the ARM consider the example with a temporary sufficient
  15. >    reason to reject the "end of function" approach? To me it appears that
  16. >    the "end of function" approach for temporaries would not cause any more
  17. >    difficulties or program bugs than those that can already occur even without
  18. >    temporaries. So why not reconsider that approach?
  19.  
  20. > I don't want my temporaries to hang around until the end of the
  21. > function. I often use large temporaries (megabytes), and I see no
  22. > reason why they should stick around any longer than I need them.
  23.  
  24. > Temporaries should get destroyed as soon as their value has been used.
  25. > To make call-by-reference a little more convenient, there is a special
  26. > rule for binding references to temporaries, and I guess that's OK.
  27.  
  28. Thomas, you're not alone.  Others feel the same way, not for hairy AI
  29. data structures but for big matrices.  The issue is being examined.
  30.  
  31. Here's a thought.  There was, at one time, a suggestion for an `operator
  32. void()' that describes the action of throwing away a value.  It gets used
  33. for anything except the intialization of an object.  Would the `operator
  34. void()' concept describe the point at which the temporary must be
  35. discarded?
  36. -- 
  37.  (This man's opinions are his own.)
  38.  From mole-end                Mark Terribile
  39.  
  40.  mat@mole-end.matawan.nj.us, Somewhere in Matawan, NJ
  41.