public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: "m." <michal017@centrum.sk>
To: gcc-help@gcc.gnu.org
Subject: Re: pure virtual w/implementation bug in GCC 3.3?
Date: Fri, 19 Sep 2003 06:29:00 -0000	[thread overview]
Message-ID: <20030919082727.18a9c7e4.michal017@centrum.sk> (raw)
In-Reply-To: <5.2.1.1.0.20030918144908.01a7c488@iplan-mn.corp.adobe.com>

How about this (taken from the standard 10.4 Abstract classes [class.abstract]):

[Note: a function declaration cannot provide both a pure-specifier and a definition ---end note] [Example:

struct C {
          virtual void f() { }=0;                 // ill-formed
};

---end example]

m.

On Thu, 18 Sep 2003 14:52:45 -0500
Eljay Love-Jensen <eljay@adobe.com> wrote:

>Hi Lyle,
>
>>Without actually looking at the standard, isn't a pure virtual function with an implementation simply a contradiction?
>
>No, it's not really the contradiction that it first appears.
>
>The compiler enforces that all derived classes implement the pure virtual function (or become marked as "abstract" themselves).
>
>A pure virtual function can have an imlpementation in that base class, such that derived classes could do a "using basefunc;" to explicitly utilize the base classes behavior implemented in the pure virtual basefunc method.
>
>I grant you, it is a bit unusual.  When I run across one, I tend to do a double take.  But just like have a "const volatile", there are appropriate situations for pure virtuals with implementations.
>
>*grin*
>--Eljay
>
>
>

  reply	other threads:[~2003-09-19  6:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-18 19:46 lrtaylor
2003-09-18 19:53 ` Eljay Love-Jensen
2003-09-19  6:29   ` m. [this message]
2003-09-19 17:32     ` Eljay Love-Jensen
  -- strict thread matches above, loose matches on Subject: below --
2003-09-19 18:46 lrtaylor
2003-09-19 19:30 ` Eljay Love-Jensen
2003-09-18 19:38 Eljay Love-Jensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030919082727.18a9c7e4.michal017@centrum.sk \
    --to=michal017@centrum.sk \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).