lmi
[Top][All Lists]
Advanced

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

[lmi] Re: Input copy ctor


From: Greg Chicares
Subject: [lmi] Re: Input copy ctor
Date: Thu, 26 Feb 2009 14:22:14 +0000
User-agent: Thunderbird 2.0.0.19 (Windows/20081209)

On 2009-02-26 14:02Z, Vadim Zeitlin wrote:
> On Thu, 26 Feb 2009 13:23:44 +0000 Greg Chicares <address@hidden> wrote:
> 
> GC> >         0 is z.CurrentCoiMultiplierRealized_.size()
> GC> >         0 is CurrentCoiMultiplier.size()
> GC> 
> GC> Here I have 55 for both sizes. I believe this is where it goes wrong.
> GC> I will scrutinize this now.
> 
>  I see that Input class copy ctor doesn't work in my (MSVC) version. I.e.

I feared that our search would lead us to that likely locus of
implementation-defined behavior.

> what happens is that Input::magically_rectify() correctly sets up

That function is of course an embarrassment.

> CurrentCoiMultiplierRealized_ but the copy created when it returns -- and
> hence the object which is passed to BasicValues ctor when it's called from
> AccountValue ctor -- has this value as empty vector.

Then it's worse than an embarrassment.

>  Unfortunately I don't understand the code in (and called from) Input copy
> ctor enough to understand whether it's a compiler bug or not. Right now I
> just don't see where is CurrentCoiMultiplierRealized_ copied there,
> AscribeMembers() only seems to deal with CurrentCoiMultiplier_ value but
> not the "Realized" vector. What am I missing here?

That's one of the things the "magical" function is supposed to handle.

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

That's what I'm thinking, too.

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




reply via email to

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