home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!mcsun!news.funet.fi!network.jyu.fi!sakkinen
- From: sakkinen@jyu.fi (Markku Sakkinen)
- Subject: Re: Quest: Multiple Virtual functions with same name
- Message-ID: <1992Nov10.101629.18067@jyu.fi>
- Organization: University of Jyvaskyla, Finland
- References: <1992Oct30.182516.20463@hplabsz.hpl.hp.com> <BxAwAK.I1B@fulcrum.co.uk> <rmartin.721096943@thor>
- Date: Tue, 10 Nov 1992 10:16:29 GMT
- Lines: 38
-
- In article <rmartin.721096943@thor> rmartin@thor.Rational.COM (Bob Martin) writes:
- >rct@fulcrum.co.uk (Richard Taylor) writes:
- >
- >|In article <1992Oct30.182516.20463@hplabsz.hpl.hp.com> kalra@PROBLEM_WITH_INEWS_GATEWAY_FILE (Deven Kalra) writes:
- >|> ...
- >|>I get compiler warnings as:
- >|>
- >|> render function hides base function
- >
- >This is to be expected, members in derived classes "hide" members in
- >base classes that have the same name. See "ARM 13.1"
- >|> ...
- > ...
- >Because it is hidden. The ARM justifies this with a reasonably
- >compelling argument.
- > ...
- >No, virtualness has nothing to do with it. The functions would have
- >been hidden regardless of whether they were virtual or not. In the
- >example, it would appear that the functions ought to be virtual.
- > ...
-
- The explanation was good and exact.
- However, I don't find the rationale in the ARM convincing in the least.
- This hiding rule causes lots of trouble to the simple use of function
- overloading, in trying to prevent some potential (probably rare) bugs.
- It's all the more questionable because the general philosophy of C++
- indeed is not preoccupied with safety devices for bad or
- sloppy programmers.
-
- ----------------------------------------------------------------------
- Markku Sakkinen (sakkinen@jytko.jyu.fi)
- SAKKINEN@FINJYU.bitnet (alternative network address)
- Department of Computer Science and Information Systems
- University of Jyvaskyla (a's with umlauts)
- PL 35
- SF-40351 Jyvaskyla (umlauts again)
- Finland
- ----------------------------------------------------------------------
-