[Top][All Lists]

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

Re: [lmi] [PATCH 3/3] Fix incorrect use of unqualified GetLabel().

From: Vadim Zeitlin
Subject: Re: [lmi] [PATCH 3/3] Fix incorrect use of unqualified GetLabel().
Date: Thu, 2 Oct 2014 16:48:56 +0200

On Thu, 02 Oct 2014 14:34:32 +0000 Greg Chicares <address@hidden> wrote:

GC> On 2014-09-29 14:30Z, Vadim Zeitlin wrote:
GC> [...]
GC> >  multidimgrid_tools.hpp | 2 +-
GC> [...]
GC> > @@ -360,7 +360,7 @@ void 
GC> >  
GC> >      while(choice.GetCount() < new_count)
GC> >          {
GC> > -        choice.Append(GetLabel(choice.GetCount() + min_value));
GC> > +        choice.Append(this->GetLabel(choice.GetCount() + min_value));
GC> >          }
GC> Okay, I see the problem, although I don't understand the solution.
GC> 'this' is of type AdjustableMaxBoundAxis<Integral>, which is
GC> derived from MultiDimAdjustableAxis, which is derived from...well,
GC> I guess ultimately this must lead to a wx class that implements
GC> GetLabel,

 No, the class hierarchy is

        MultiDimAdjustableAxis<T,MultiDimIntegralAxis<Integral>> // CRTP

and GetLabel() is a pure virtual method of MultiDimAxisAny (which doesn't
derive from any wx-related class) and its implementation is provided by

GC> though I didn't take the time to follow every link in a
GC> chain whose end I can't immediately see. Would it be okay if I
GC> instead used applied the following change?
GC> -        choice.Append(GetLabel(choice.GetCount() + min_value));
GC> +        choice.Append(choice.GetLabel(choice.GetCount() + min_value));
GC> I figure that 'choice.Append()' and 'choice.GetCount()' are
GC> already known to work, so 'choice.GetLabel()' should work as well.

 I didn't test it, so this might work as well if the same labels are used
by wxChoice and MultiDimIntegralAxis<Integral>::GetLabel(), but this
doesn't look obvious, so I'd rather apply my proposed change and avoid
changing the code behaviour if it runs correctly now.


reply via email to

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