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