Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!rutgers!att!watmath!watserv1!pdevries From: pdevries@watserv1.waterloo.edu (Peter DeVries) Newsgroups: comp.lang.c++ Subject: More ZOrtech c++ Keywords: overloading, inheritance, zortech Message-ID: <1990Jul23.161817.23460@watserv1.waterloo.edu> Date: 23 Jul 90 16:18:17 GMT Distribution: comp Organization: University of Waterloo Lines: 46 example: Class A: { virtual void SetSomething(int,double); virtual void SetSomething(int,long); }; Class B: public A { void SetSomething(int,double); }; main() { B b; long l; int i; b.SetSomething(i,l); //CALLS B.SetSomething(int,double) } I REALLY don't understand this. Walter replied to this problem that it is NOT a compiler bug. That declaring SetSomething(int,double) in the derived class hides ALL inherited declarations of SetSomething, INCLUDING overloaded ones. SAY WHAT? This goes against any common sense that I may have. Why would overloaded functions work so differently than the intuitive approach. (ie. as inheritance usually works). The function name is completely different since the parameters are of different types, so why would one function in the derived class have any affect on accessing the other ones? By the way, it will call B.SetSomething(int,double) even if I explicitly cast the value to a LONG. Peter DeVries Mutual Life of Canada c/o pdevries@watserv1.waterloo.edu (519) 888-3523, (416) 972-0594 -- Peter DeVries Mutual Life of Canada c/o pdevries@watserv1.waterloo.edu (519) 888-3523, (416) 972-0594