From 9032547743269706910
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,f5d433881cc29cff
X-Google-Attributes: gidf78e5,public
From: Jason Merrill <jason@cygnus.com>
Subject: Re: Named return value optimisation- reprise.
Date: 1997/06/16
Message-ID: <u9pvtnuemu.fsf@yorick.cygnus.com>#1/1
X-Deja-AN: 248861486
References: <33a345bf.7425526@news.ipswich.gil.com.au> <33A478C1.329@acm.org>
X-Original-Date: 16 Jun 1997 01:38:01 -0700
Organization: Cygnus Solutions, Sunnyvale, CA
X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUBM6Vw9OEDnX0m9pzZAQGp4QGAgVbMGrxLN+v2dufx5gWsfoH9eGEUvQkV Mwp7hSOoN/ZPsBO28ptR9OPT7IzXjeFZ =Veem
Newsgroups: comp.std.c++
Originator: fjh@murlibobo.cs.mu.OZ.AU


>>>>> Pete Becker <petebecker@acm.org> writes:

> 	Skipping the copy constructor is not legal. The object A consists of
> the storage allocated for A itself and the array 'a'.

That's an unusual definition of 'object', which does not match the
definition in [intro.object].

I thought we discussed this before and decided that 12.8 was referring to
the actual object itself, not the object and everything it points to.  So
the example would produce surprising results in the presence of the RVO.

But I'm OK with that.  I'm comfortable saying that playing games with
references and values in the same class, and relying on the copy
constructor to switch between them, is asking for trouble.

Jason
---
[ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
[ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
[ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
[ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]



