Q
Qimonda
FAQ 23.9 explains the hiding mechanism und the use of using declarations to
un-hide base class member functions.
Will this also work when the base class has multiple overloads which are
hidden?
Example:
class Base
{
public:
virtual void f( double ) {}; // all member functions defined here.
virtual void f( double * ) {};
virtual void f( double ** ) {};
};
class Derived : public Base
{
public:
virtual void f( double x ) { /*do sth. with x */ };
using Base::f; // Does that un-hide all other overloads in Base, i.e.
Base::f( double * ) and Base::f( double ** )?
};
At least g++ stops issuing warning messages with the using declaration.
Best regards,
Georg
Qimonda AG
Chairman of the Supervisory Board/ Aufsichtsratsvorsitzender: Peter J.
Fischl
Management Board/ Vorstand: Kin Wah Loh (Chairman/ Vorsitzender), Dr.
Michael Majerus, Thomas J. Seifert
Register Court/ Registergericht: München HRB 152545, Seat/ Sitz: München
un-hide base class member functions.
Will this also work when the base class has multiple overloads which are
hidden?
Example:
class Base
{
public:
virtual void f( double ) {}; // all member functions defined here.
virtual void f( double * ) {};
virtual void f( double ** ) {};
};
class Derived : public Base
{
public:
virtual void f( double x ) { /*do sth. with x */ };
using Base::f; // Does that un-hide all other overloads in Base, i.e.
Base::f( double * ) and Base::f( double ** )?
};
At least g++ stops issuing warning messages with the using declaration.
Best regards,
Georg
Qimonda AG
Chairman of the Supervisory Board/ Aufsichtsratsvorsitzender: Peter J.
Fischl
Management Board/ Vorstand: Kin Wah Loh (Chairman/ Vorsitzender), Dr.
Michael Majerus, Thomas J. Seifert
Register Court/ Registergericht: München HRB 152545, Seat/ Sitz: München