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.715268992@thor>
- Date: 31 Aug 92 13:49:52 GMT
- References: <MCGRANT.92Aug26232410@rascals.stanford.edu> <23563@alice.att.com> <rmartin.715004480@thor> <23583@alice.att.com> <rmartin.715101472@thor> <23590@alice.att.com>
- Sender: news@Rational.COM
- Lines: 28
-
- ark@alice.att.com (Andrew Koenig) writes:
-
- |In article <rmartin.715101472@thor> rmartin@thor.Rational.COM (Bob Martin) writes:
-
- |> No, I want a warning every time a temporary gets converted into a
- |> pointer.
-
- |All that will do is cause library authors to write little classes
- |that contain pointers to suppress warnings. Or maybe they'll use
- |explicit member function calls instead of implicit conversions.
-
- These strategies should not supress the warnings. ANY time an address
- or reference to a temporary is taken, whether is is via implicit
- conversion, or as the argument of a member function, a warning should
- be issued. No exceptions.
-
- This will flag every instance where a long lived alias to a temporary
- could be created. Unfortunately it will also flag the creation of
- perfectly benign aliases. As I said in an earlier post, compiler
- writers could implement #pragmas which allowed programmers to
- name functions which were known to create benign aliases.
-
-
- --
- 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++
-