monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] Re: MM with temporaries


From: Steven E. Harris
Subject: [Monotone-devel] Re: MM with temporaries
Date: Fri, 23 Sep 2005 08:27:20 -0700
User-agent: Gnus/5.110004 (No Gnus v0.4) XEmacs/21.4.13 (cygwin32)

Nathaniel Smith <address@hidden> writes:

> I don't quite see this.  Quoting the above note 5:

I just realized that "5" is not a footnote, but a paragraph
number. Sorry about that.

[...]

> IIUC, we have a temporary bound to a reference member, but we need
> it to persist until the object is destructed, which is much longer
> than "until the constructor exits"...

I'm not sure you're binding the temporary to the member; you're
binding the constructor argument reference to the member. The
temporary is bound to the constructor argument, although maybe by
transitivity it's all the same.

But even then, this difference wouldn't help, as:

  A temporary bound to a reference parameter in a function call
  (5.2.2) persists until the completion of the full expression
  containing the call.

That's the same problem.

But I don't know what MM() looks like or what it does. Does it just
create a Musing instance, which does all its magic in its constructor,
or does it access members of the Musing instance and depend upon
destructor behavior? I ask because we know that the temporary stays
valid for the duration of the Musing constructor. Does it need to stay
valid longer than that for your purposes?

-- 
Steven E. Harris





reply via email to

[Prev in Thread] Current Thread [Next in Thread]