This code fragment compiles fine with
cxx -c trial.C
but bombs out when compiled
cxx -std strict_ansi -c trial.C
cxx: Error: trial.C, line 9: class "Foo::Pimpl" is inaccessible
func(&Foo::Pimpl::bar);
----------------------------^
cxx: Warning: trial.C, line 11: nonstandard form for taking the address of a
member function
func(&bar);
----------------------^
cxx: Info: 1 error detected in the compilation of "trial.C".
---------- Forwarded Message ----------
Subject: Re: SigC++ related cxx error
Date: 23 Jun 2000 19:03:47 +0200
From: Jean-Marc Lasgouttes <[EMAIL PROTECTED]>
JMarc> I have come up with the following example to demonstrate what
JMarc> happens. Lars, is it right? If it is, I'll ask on comp.lang.c++
JMarc> and the tru64 group.
Angus> Well, where is it? A.
Hmm, did I forget it? Time to leave for the week end, it seems...
JMarc
template <class T> void func(void (T::*f)(int) ) {;}
class Foo {
private:
class Pimpl {
void bar(int);
Pimpl() {
// this is supposed to be the right way
func(&Foo::Pimpl::bar);
// this almost works
func(&bar);
}
};
};
-------------------------------------------------------