This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
`using base::member;' does not work
- To: egcs at cygnus dot com
- Subject: `using base::member;' does not work
- From: Ryszard Kabatek <rysio at rumcajs dot chemie dot uni-halle dot de>
- Date: Sat, 19 Sep 1998 13:58:12 +0200 (CEST)
The sample comes from the B. Stroustrup's book
"The Design and Evolution of C++".
It does make the B::f member function available
for class D trough the using directive.
The egcs-1.1 doesn't compile this sample.
eg++ main.cc
main.cc:15: cannot adjust access to `void B::f(char)' in `class D'
main.cc:13: because of local method `void D::f(int)' with same name
# include <iostream.h>
class B {
public:
void f(char c) {cout << c << '\n';}
};
class D : public B {
public:
void f(int c) {cout << c << '\n';} // line 13
using B::f;
};
int main()
{
D d;
d.f('x');
}
My configuration:
Linux (RedHat 5.1), Pentium II
egcs-1.1
Ryszard Kabatek
Martin-Luther University Halle-Wittenberg
Department of Physical Chemistry
Geusaer Str. 88, 06217 Merseburg, Germany
Tel. +49 3461 46 2487 Fax. +49 3461 46 2129
e-mail: kabatek@chemie.uni-halle.de