egcs-971225 G++ bug report

Michael A. Benzinger mbenz@sabre.com
Fri Jan 9 06:20:00 GMT 1998


Hi David,

I just read over the page in Stroustrup's book.  His example has
an ampersand (&) to take the address of the member function.  The
example you posted does not.  Could this be the problem?  Does C++
now require the & to take the address of a function?  Is this only
required for member functions?

His example also did not have const in the type definition but I
don't know if that makes any difference.

Mike Benzinger

At 01:32 PM 1/9/98 GMT, David Binderman wrote:
>>David,
>>
>>Now this may be something just esoteric enough in the language that
>>I don't know about it, but can you take the address of a non-static
>>member function from the class definition?  
>
>Yes. Please see Stroustrup Edition 3 page 419 for an example.
>
>>Any enlightenment?
>
>What I noticed that the egcs compiler didn't check up on is the const/
>non-const. It seems that more checking is required.
>
>Take the const keywords out of the example I gave, and watch it compile
>ok on any C++ or G++ compiler.
>
>Regards
>
>David C Binderman MSc BSc (Hons)		+44 171 971 8765
>contracting at Mobile Systems International in the Docklands, London, England
>
>Celebrating ten years of C++ providing me all the beer and petrol tokens
>I need.
>
>
-------------------------------------------------------------
Michael A. Benzinger
Principal

SABRE Technology Solutions        Phone:  +1 817-264-6820
1 E. Kirkwood Blvd.               Fax:    +1 817-264-3504
Southlake, TX  76092              e-mail: mbenz@sabre.com
U.S.A.                                    bzinger@iName.com



More information about the Gcc-bugs mailing list