public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: mrs@wrs.com (Mike Stump)
To: adriang@adriang.ce.mediaone.net, egcs@egcs.cygnus.com
Subject: Re: Problems invoking a member function through pointers.
Date: Tue, 22 Dec 1998 11:15:00 -0000	[thread overview]
Message-ID: <199812221914.LAA25285@kankakee.wrs.com> (raw)

> Date: Mon, 21 Dec 1998 23:08:06 -0600 (EST)
> From: <adriang@adriang.ce.mediaone.net>
> To: egcs@egcs.cygnus.com

> In the following code I would expect the output to be:
> Base::M1
> Base::M1
> Base::M2
> Base::M2

> To my surprise, the last line of the output says
> Derived::M2

This isn't the right group to learn C++ programming, comp.lang.c++ is
a better place.  Yes, this is what virtual means.  virtual means call
the most derived function in your class hierarchy.  If you don't want
that behavior, don't use virtual.

obj.Base::M2 () != obj .* (&Base::M2) ()

             reply	other threads:[~1998-12-22 11:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-12-22 11:15 Mike Stump [this message]
  -- strict thread matches above, loose matches on Subject: below --
1998-12-21 21:09 adriang
1998-12-21 21:37 ` Alexandre Oliva

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=199812221914.LAA25285@kankakee.wrs.com \
    --to=mrs@wrs.com \
    --cc=adriang@adriang.ce.mediaone.net \
    --cc=egcs@egcs.cygnus.com \
    /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).