From: lasgoutt@fantomas.inria.fr (Jean-Marc Lasgouttes)
Subject: CXX 6.1-027 and pointer-to-member of private classes.
Date: 2000/06/23 [thread overview]
Message-ID: <8j01g7$t31$1@ites.inria.fr> (raw)
Hello,
I am currently running into problems in the use of the SigC++ library
which boild down to the following short example:
--------------
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, but is not standard
func(&bar);
}
};
};
--------------
When compiling this code with digital C++ 6.1-027 in strict_ansi mode,
I get a warning for the second form (as the standard says), but the
first one gives me an error:
cxx: Error: bug.C, line 9: class "Foo::Pimpl" is inaccessible
func(&Foo::Pimpl::bar);
-----------------------------------^
However, when compiling with gcc 2.95.2 (-Wall -ansi -pedantic) the
first form is accepted without problem.
So, is that a bug in this cxx version (and in this case, has it been fixed
since then) or should the example program be changed to comply with
the standard?
Thanks in advance for any help.
JMarc
--
-------------------------------------------------
Jean-Marc Lasgouttes, Projet MEVAL, INRIA, France
e-mail : jean-marc.lasgouttes@inria.fr
reply other threads:[~2000-06-23 4:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox