This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Named return values in C++ doesn't work ?
- To: Mike Stump <mrs at wrs dot com>, egcs at cygnus dot com
- Subject: Re: Named return values in C++ doesn't work ?
- From: Sylvain Pion <Sylvain dot Pion at sophia dot inria dot fr>
- Date: Tue, 29 Sep 1998 21:47:57 +0200
- References: <199809291922.MAA13575@kankakee.wrs.com>
On Tue, Sep 29, 1998 at 12:22:57PM -0700, Mike Stump wrote:
> > Also, it's a pity (as written in the doc) that we can't specify the
> > exact location of the constructor. Is someone working on
> > implementing such a feature ?
>
> ? I can't guess what you mean.
The constructor of the returned object must be at the beginning of the
function (before any code), if you want to use the "named return value"
extension. But I would like it to be after some instruction.
Precisely, I refer to the following comment in the gcc doc:
"The disadvantage of this extension is that you do not control when the
default constructor for the return value is called: it is always called at the
beginning."
However, I'd first like this feature to work (maybe it's my fault, but the
simple example I gave doesn't work).
--
Sylvain