Re: why make non-pure virtual functions?
From: jeffc (nobody_at_nowhere.com)
Date: 03/15/04
- Next message: jeffc: "Re: why make non-pure virtual functions?"
- Previous message: Kenny McCarty: "array of structs"
- In reply to: Pete Vidler: "Re: why make non-pure virtual functions?"
- Next in thread: Pete Vidler: "Re: why make non-pure virtual functions?"
- Reply: Pete Vidler: "Re: why make non-pure virtual functions?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 15 Mar 2004 15:24:28 -0500
"Pete Vidler" <pvidler@mailblocks.com> wrote in message
news:NMn5c.41$jr2.23@newsfe1-win...
> jeffc wrote:
> [snip]
> >>Right. I think it would have been better to require the virtual keyword
> >>in all the derived classes. If you don't specify 'virtual' in the
> >>derived class, and someone looks at that class's header, he won't know
> >>which of the member functions are re-implementations of virtual member
> >>functions. He would first have to go up the inheritance tree and search
> >>through all the base classes to find that out.
>
> [snip]
> > void f() {
> > cout << "A::f" << endl;
> > }
> [snip]
>
> You have to specify it as virtual in the base class. If it's left out in
> the *derived* class there is no difference.
My point is you still have to look at the base class regardless of how it's
defined in the subclass.
- Next message: jeffc: "Re: why make non-pure virtual functions?"
- Previous message: Kenny McCarty: "array of structs"
- In reply to: Pete Vidler: "Re: why make non-pure virtual functions?"
- Next in thread: Pete Vidler: "Re: why make non-pure virtual functions?"
- Reply: Pete Vidler: "Re: why make non-pure virtual functions?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|