Article View: comp.std.c++
Article #2011virtual overload differing in return type only?
From: Jim Garrison
Date: Sat, 23 Sep 1995 16:02
Date: Sat, 23 Sep 1995 16:02
25 lines
1132 bytes
1132 bytes
The ARM states that it is illegal to declare a function in a
derived class that differs from a virtual in a parent class by
only its return type. I.e.
class A
{
virtual int foo();
}
class B1 : public A
{
char * foo(); // Illegal
}
Has the standard changed with respect to this? IBM VisualAge C++
now allows this (it's an EXTREMELY useful thing to be able to do),
but the SGI compiler on which I'm working doesn't.
Jim Garrison
jhg@acm.org
---
[ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu.
Contact address: std-c++-request@ncar.ucar.edu. The moderation policy
is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID:
<43s5k2$nk6@gorby.mpd.tandem.com>Path:
arc1-ca.pugleaf.net!in2.uu.net!bounce-backShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!in2.uu.net!bounce-back Date: 23 Sep 95 16:02:22 GMT Approved: fjh@cs.mu.oz.au From: jhg@mpd.tandem.com (Jim Garrison) Newsgroups: comp.std.c++ Subject: virtual overload differing in return type only? X-Original-Date: 21 Sep 1995 16:58:42 GMT Organization: Tandem Computers,Inc. (Austin, TX) Message-ID: <43s5k2$nk6@gorby.mpd.tandem.com> Reply-To: jhg@mpd.tandem.com X-Newsreader: IBM NewsReader/2 v1.2