This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Visibility problems in gcc 2.95.2
On 9 ïËÔÑÂÒØ 2000 14:54, Artem Khodush wrote:
> Denis Perchine wrote:
> > test.cpp:27: no matching function for call to `B::rread (char *&, int
> > &)'
> > test.cpp:18: candidates are: bool B::rread (C *, char *)
> >
> > This is obviously wrong as there is one in the class A.
> >
> > class A {
> > public:
> > A(){};
> > ~A(){};
> > bool rread(char* packet, int size){};
> > };
> >
> > class B : public A {
> > public:
> > B(){};
> > ~B(){};
> > bool rread(C* hdr, char *data){};
> > };
>
> This is not a bug.
> It may seem wrong to you, but that's how c++ works.
> The declaration of rread in class B hides one in class A.
Could you please give me reference to a standard, if it is not so hard for
you. I'm just wondering why it is the case. Methods have different
signatures...
> However, you still may call A's rread by specifying it
> explicitly:
>
> b.A::rread( packet, size );
>
> Best regards,
> Artem.
--
Sincerely Yours,
Denis Perchine
----------------------------------
E-Mail: dyp@perchine.com
HomePage: http://www.perchine.com/dyp/
FidoNet: 2:5000/120.5
----------------------------------