Overloading/Inheritance issue

Derek Parnell derek at nomail.afraid.org
Thu Aug 2 17:02:17 PDT 2007


On Thu, 02 Aug 2007 12:26:14 +0100, Regan Heath wrote:

> I would have thought that given your personal preference for being 
> explicit in many cases you would prefer the C++ approach?

LOL ... it is obvious that I don't do much OO programming isn't it.

I turns out that I misunderstood the issue all this time. I did some
playing around this morning and I now have a better knowledge base to work
from. 

My first, and biggest mistake, was thinking that EVERY name in the parent
class was hidden from the derived class unless aliased. Now I realize that
its only the ones with the same names explicitly defined in the derived
class are hidden. 

My second mistake was thinking that aliasing only worked for one level of
derivation. In other words if C is derived from B, and B is derived from A,
I thought that C couldn't get access to A methods unless they were aliased
in B. I now know this is thinking is wrong.

I guess over time I'll get to appreciate this :)

-- 
Derek
(skype: derek.j.parnell)
Melbourne, Australia
3/08/2007 9:53:20 AM



More information about the Digitalmars-d mailing list