home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!igor!thor!rmartin
- From: rmartin@thor.Rational.COM (Bob Martin)
- Newsgroups: comp.lang.c++
- Subject: Re: destruction of temporaries
- Message-ID: <rmartin.714434539@thor>
- Date: 21 Aug 92 22:02:19 GMT
- 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>
- Sender: news@Rational.COM
- Lines: 22
-
- tmb@arolla.idiap.ch (Thomas M. Breuel) writes:
-
-
- |The question is: what should be the default. I don't think that
- |mandatory late destruction solves anything, because if you start
- |relying on the persistence of temporaries in expressions, the next
- |step is that you'll get confused about why they don't hang around for
- |the whole block.
-
- Agreed. In my opinion, we should not even have to think about
- temporaries. The compiler should quietly use them in foolproof
- situations, and quickly destroy them. In any situation where a
- pointer or reference to a temporary is being taken, the compiler
- should complain. I would not be at all adverse to having the compiler
- treat the taking of the address or reference of a temporary as an
- error.
-
- --
- Robert Martin Training courses offered in:
- R. C. M. Consulting Object Oriented Analysis
- 2080 Cranbrook Rd. Object Oriented Design
- Green Oaks, Il 60048 (708) 918-1004 C++
-