Angus Leeming <[EMAIL PROTECTED]> writes:

| 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);

Ok I get it... a bit slow it seems...

move the class to public:
_or_ make the inner class a friend of the outer class.
(I think I prefere friend)

Can you try that with the short example from Jean-Marc?

        Lgb

| template <class T> void func(void (T::*f)(int) ) {;}
| 
| class Foo {
| private:
|       friend class Pimpl;
| "or"  friend class Foo::Pimpl;
|       class Pimpl {
|               void bar(int);
|               Pimpl() {
|                       // this is supposed to be the right way
|                       func(&Foo::Pimpl::bar);
|                       // this almost works
|                       func(&bar);
|               }
|       };
| };

Reply via email to