delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/08/02/17:22:23

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>,
<http://sourceware.cygnus.com/ml/#faqs>
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-Id: <199908022004.PAA21407@mercury.xraylith.wisc.edu>
To: "Ward Correll" <wardless AT hotmail DOT com>
cc: cygwin AT sourceware DOT cygnus DOT com
Subject: Re: Maybe a Bug in Cygwin in using Pointers to class fuctions
In-Reply-To: Your message of "Mon, 02 Aug 1999 16:52:14 EDT."
<19990802205215 DOT 22723 DOT qmail AT hotmail DOT com>
Date: Mon, 02 Aug 1999 15:04:53 -0500
From: Mumit Khan <khan AT xraylith DOT wisc DOT EDU>

"Ward Correll" <wardless AT hotmail DOT com> writes:

> Maybe a bug in Cygwin! I think that this sorce code is correct in the Final
> ANSI\ISO standard on C++ so I think it could be cygwin. Please check it out
> for me in this simple code.

It's not a bug. Please see the discussion on pointer to member function
in a recent C++ book such as Stroustrup 3rd edition. Of course, the
best place is the ISO standard itself (cf: 8.3.3 [dcl.mptr]/2), but that
can be rather obtuse.

It's also a good idea to report what version of compiler you're using and
some system/OS info (gcc -v reports the compiler version).

>               case 1: pFunc = Mammal::Speak; break;
>               default: pFunc = Mammal::Move; break;
                                 ^^^^^^

> BASH.EXE-2.02$ c++ -o try try.cpp
> test.cpp: In function `int main()':
> test.cpp:66: assuming & on `Mammal::Speak'
> test.cpp:67: assuming & on `Mammal::Move'
> =====================================================================
> I know I want the fuction pointer to assume on Mammal::Speak or Mammal::Move
> when meets some conditions as you see. But cygwin won't let me do that.
> Anyway to force compiling?

The compiler gave you the answer, so use it! (hint: Mammal::Speak -->
&Mammal::Speak).

Followup to a C++ forum please.

Regards,
Mumit


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


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