lmi
[Top][All Lists]
Advanced

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

Re: [lmi] Re: Input copy ctor


From: Vadim Zeitlin
Subject: Re: [lmi] Re: Input copy ctor
Date: Thu, 26 Feb 2009 15:26:10 +0100

On Thu, 26 Feb 2009 14:22:14 +0000 Greg Chicares <address@hidden> wrote:

GC> >  Or could it be that g++ applies the RVO here and doesn't use this copy
GC> > ctor at all (while MSVC definitely doesn't apply it in debug builds, which
GC> > is what I use)?
GC> 
GC> That's what I'm thinking, too.

 It would probably be easy enough to test for this by adding printf() into
Input copy ctor but after looking at the code more carefully I'm almost
certain that this is indeed the explanation as I just don't see how can the
copy ctor preserve CurrentCoiMultiplierRealized_ value if it is called.

GC> Please try the ugly idea in my 2009-02-26T14:10Z message first. If
GC> that doesn't "fix" the problem, at least well enough to get us past
GC> the immediate obstacle, then I guess we'll have to transplant some
GC> of the "magic" into the copy ctor (and operator=() too).

 The fix is enough for me but I think it would be really better to do it in
copy ctor and operator=() -- why not? After all, the object is supposed to
be completely and not just partially copied by these functions.

 Thanks again for taking time to look into this,
VZ

reply via email to

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