This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


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

C++ member function pointers in ISO C++


We are trying to compile some library code that passes the address of an
objects member
function together with the objects address to be used in a call-back
method. Having upgraded
to GCC 2.96 we now get a compilation error " ISO C++ forbids taking the
address of a
non-static member  function to form a pointer to member function.  Say
`&A::Func1'"

Questions:
1. Is there a proper way in ISO C++ of passing and storing a pointer to
a member function ?
2. Is there a compiler switch or other mechanism to allow the previous
GCC behaviour ?

Cheers

Terry

--
  Dr Terry Barnaby                     BEAM Ltd
  Phone: +44 1454 324512               Northavon Business Center, Dean Rd
  Fax:   +44 1454 313172               Yate, Bristol, BS37 5NH, UK
  Email: terry@beam.demon.co.uk        Web: www.beam.demon.co.uk
  BEAM for: Visually Impaired X-Terminals, Parallel Processing, Software Dev
                         "Tandems are twice the fun !"




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