This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Named return values in C++ doesn't work ?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]