Renaming of virtual functions

Aleix Pol aleixpol at kde.org
Sat Oct 3 01:21:08 UTC 2009


On Fri, Oct 2, 2009 at 6:04 PM, Hugo Parente Lima <hugo.pl at gmail.com> wrote:

> On Friday 02 October 2009 20:54:57 Carlos Licea wrote:
> > Dear list,
> >       I've just found a problem, consider the following classes:
> >
> >       class A
> >       {
> >               virtual someFunction();
> >       }
> >
> >       class B : public A
> >       {
> >               virtual someFunction();
> >       }
> >
> > Now I tried to rename B::someFunction() because the way it was being done
> >  was more accurate for an internal function... but the change propagated
> to
> >  the base class, so in the end I had something like this:
> >
> >       class A
> >       {
> >               virtual someFunctionPrivate();
> >       }
> >
> >       class B : public A
> >       {
> >               virtual someFunctionPrivate();
> >       }
> >
> > When I expected
> >
> >       class A
> >       {
> >               virtual someFunction();
> >       }
> >
> >       class B : public A
> >       {
> >               virtual someFunctionPrivate();
> >       }
> >
> > So that I could later reimplement someFunction properly...
> >
> > I think that the current behavior is kind of unexpected, at least for me;
> I
> > don't think that changing the derived class should change the base
> class...
> >  at least not by default.
> > I think that asking the user if he wants to propagate the changes from a
> > derived/base class to a derived/base class when renaming a virtual
> function
> >  is the proper thing to do. What do you think?
>
> The way it works is right, you are just a ultra corner case :-P, but asking
> the user is always the best way.
>
> > Carlos
> >
> > _______________________________________________
> > KDevelop-devel mailing list
> > KDevelop-devel at kdevelop.org
> > https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel
> >
>
> --
> Hugo Parente Lima
> "Precisamos de mais gênios humildes no mundo, hoje somos poucos!"
> JID: hugo at jabber.org
>
> _______________________________________________
> KDevelop-devel mailing list
> KDevelop-devel at kdevelop.org
> https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel
>
>
I don't really think asking the user is the best way, and I don't think this
is a corner case.

If you wanted to differentiate, you first had to rename the class B method
to tell KDevelop it's something different.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20091002/3c22f33b/attachment.html>


More information about the KDevelop-devel mailing list