home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!stanford.edu!lucid.com!lucid.com!jss
- From: jss@lucid.com (Jerry Schwarz)
- Subject: Re: Destruction of temporaries
- Message-ID: <1992Sep3.020851.7240@lucid.com>
- Sender: usenet@lucid.com
- Reply-To: jss@lucid.com (Jerry Schwarz)
- Organization: Lucid, Inc.
- References: <rmartin.715267769@thor> <1992Sep2.042030.488@frumious.uucp> <1992Sep2.192339.2774@lucid.com> <1992Sep2.223451.24804@tfs.com>
- Date: Thu, 3 Sep 92 02:08:51 GMT
- Lines: 34
-
- In article <1992Sep2.223451.24804@tfs.com>, eric@tfs.com (Eric Smith) writes:
- |> In article <1992Sep2.192339.2774@lucid.com> jss@lucid.com (Jerry Schwarz) writes:
- |> > h( ostrstream() ) ;
- |> >
- |> >but not
- |> >
- |> > h ( ostrstream() << "contents" << ends ) ;
- |>
- |>
- |> Wrong. Both calls are with a temporary. Both should be equally illegal.
-
- I didn't specify h in the original. I assumed it was obvious
- that it would be a function that didn't retain or return it's
- ostrstream& argument. So I thought h(ostream()) would be ok.
- Recall that the argument passing is defined to be equivalent
- to initialization so if I can't do the function call, then I
- can't do
-
- ostrstream& o = ostrstream() ;
-
- either.
-
-
- Perhaps Eric will reconsider his comments in that light.
-
- -- Jerry Schwarz
-
-
-
-
-
-
-
-
-