* CXX 6.1-027 and pointer-to-member of private classes.
@ 2000-06-23 4:00 Jean-Marc Lasgouttes
0 siblings, 0 replies; only message in thread
From: Jean-Marc Lasgouttes @ 2000-06-23 4:00 UTC (permalink / 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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2000-06-23 4:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-06-23 4:00 CXX 6.1-027 and pointer-to-member of private classes Jean-Marc Lasgouttes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox