www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/08/13/13:00:29

From: Dietmar Kuehl <dietmar DOT kuehl AT claas-solutions DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: covariant return types
Date: Fri, 13 Aug 1999 15:52:06 GMT
Organization: Deja.com - Share what you know. Learn what you don't.
Lines: 32
Message-ID: <7p1ev2$2kb$1@nnrp1.deja.com>
References: <934394159 DOT 15217 AT www DOT remarq DOT com>
NNTP-Posting-Host: 145.253.2.41
X-Article-Creation-Date: Fri Aug 13 15:52:06 1999 GMT
X-Http-User-Agent: Mozilla/2.0 (compatible; MSIE 3.0B; Win32)
X-Http-Proxy: 1.0 TLC-FFS028:8000, HTTP/1.0 10.14.5.129 (IBM-WTE), 1.0 x22.deja.com:80 (Squid/1.1.22) for client 145.253.2.41
X-MyDeja-Info: XMYDJUIDdietmar_kuehl
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

In article <934394159 DOT 15217 AT www DOT remarq DOT com>,
  Dr Soil <c DOT b DOT s DOT teh AT reading DOT ac DOT uk> wrote:
> class base
> {
>    virtual base *Get();
> }
>
> class der : public base
> {
>    virtual der *Get();
> }

This code does, of course, not compile! But the problem is not that
covariant return types are not implemented but rather that there are
two semicolon missing in this code. I don't know what version of gcc
the current djgpp is based on but gcc support covariant returns since
quite a while (I think covariant returns where in prior to gcc-2.7.2). Thus,
I would expect that it does support this stuff. However, it apparently has
problems in more complex cases:

  class foo { virtual foo* clone(); };
  class bar { virtual bar* clone(); };
  class foobar: virtual foo, virtual bar { foobar* clone(); };

This does not zet work.
--
<mailto:dietmar DOT kuehl AT claas-solutions DOT de>
homepage: <http://www.informatik.uni-konstanz.de/~kuehl>


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019