Renaming of virtual functions
Hugo Parente Lima
hugo.pl at gmail.com
Sat Oct 3 01:04:51 UTC 2009
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20091002/66184cdb/attachment.sig>
More information about the KDevelop-devel
mailing list