|
|
От: | Lorenzo_LAMAS | |
| Дата: | 18.12.07 14:17 | ||
| Оценка: | |||
The alias created by the using-declaration has the usual accessibility for a member-declaration.
[Example:
class A {
private:
void f(char);
public:
void f(int);
protected:
void g();
};
class B : public A {
using A::f; // error: A::f(char) is inaccessible
public:
using A::g; // B::g is a public synonym for A::g
};
—end example]
class Base
{
public:
protected:
void test();
};
class Derived : public Base
{
public:
using Base::test;
};
int main()
{
using namespace std;
Derived d;
d.test();
vector<Derived> v;
&Derived::test;
for_each(v.begin(), v.end(), mem_fun_ref(&Derived::test));
}