Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!bellcore!faline!thumper!ulysses!andante!alice!ark From: ark@alice.UUCP (Andrew Koenig) Newsgroups: comp.lang.c++ Subject: Re: fixing pitfall in virtual members Message-ID: <8920@alice.UUCP> Date: 15 Feb 89 15:29:27 GMT References: Distribution: comp Organization: AT&T Bell Laboratories, Liberty Corner NJ Lines: 20 In article , dove@rocket.stars.flab.Fujitsu.JUNET (Webster Dove) writes: > My recommendation is the following: eliminate the requirement to > restate the syntax of virtual functions in the derived class > declaration. If they must be restated, require the keyword "shadow" > in front to explicitly connote that the declaration must "hook up" > with an identical virtual declaration in the base class. This would > have given my two staff obvious syntax errors to correct and reduced > the expended time by orders of magnitude. Here's a much easier solution: Issue a warning when a non-virtual function declaration hides a virtual function with the same name declared in a base class. Adding a new keyword is not a minor change. -- --Andrew Koenig ark@europa.att.com