This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Maybe a Bug in Cygwin in using Pointers to class fuctions


Ward Correll wrote:

> =========================OUTPUT FROM CYGWIN==========================
> 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.

Give this a try.  It seems GCC is picky about the address of a function and/or
member function.  It wants you to explicitly use the address operator as shown
below.  I think this should work.

                case 1: pFunc = &Mammal::Speak; break;
                default: pFunc = &Mammal::Move; break;

Brendan Simon.



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]