Article View: comp.std.c++
Article #832Re: Co-ordinating the polymorphism in C++
From: Chip Salzenberg
Date: Mon, 18 Feb 1991 14:27
Date: Mon, 18 Feb 1991 14:27
28 lines
2042 bytes
2042 bytes
According to craig@gpu.utcs.utoronto.ca (Craig Hubley):
>I want the compiler to override the base class's function wherever
>a derived function is defined that
> - accepts a parameter list convertible to one the base would accept
> - returns a value of a type convertible to one returned by base
>my definition of "convertible" is quite restrictive here: pointers to
>derived classes, which are legal substitutes for pointers to bases.
In the abstract, I like this idea.
On the other hand, the fact that this rule has not existed in the
language to date means that currently unrelated functions, which are
separated perhaps by several layers of derivation, would suddenly
become alternative implementations of the same virtual function.
Also, member functions that are separately legal would suddenly
conflict with each other if they were both valid overrides for a
virtual function in a base class.
If C++ were still being designed, or were still in use only internally
to AT&T, this change might have a chance. But I think it's too late.
Code that has already been written depends on all definitions of a
given virtual function being identical. For the ANSI committee to
change this significant aspect of the language would be irresponsible.
--
Chip Salzenberg at Teltronics/TCT <chip@tct.uucp>, <uunet!pdn!tct!chip>
"I want to mention that my opinions whether real or not are MY opinions."
-- the inevitable William "Billy" Steinmetz
Technical Details
Message-ID:
<27BFE464.3FB9@tct.uucp>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!spool.mu.edu!samsung!usc!elroy.jpl.nasa.gov!ames!vsi1!daver!tscs!tct!chipReferences:
<600@taumet.com> <DSOUZA.91Feb14151948@optima.cad.mcc.com> <1991Feb16.114422.14266@gpu.utcs.utoronto.ca>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!spool.mu.edu!samsung!usc!elroy.jpl.nasa.gov!ames!vsi1!daver!tscs!tct!chip From: chip@tct.uucp (Chip Salzenberg) Newsgroups: comp.std.c++ Subject: Re: Co-ordinating the polymorphism in C++ Message-ID: <27BFE464.3FB9@tct.uucp> Date: 18 Feb 91 14:27:48 GMT References: <600@taumet.com> <DSOUZA.91Feb14151948@optima.cad.mcc.com> <1991Feb16.114422.14266@gpu.utcs.utoronto.ca> Organization: Teltronics/TCT, Sarasota, FL Lines: 28