 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
class
base {
|
|
public:
|
|
void fun(int) {
|
|
cout
<<"base::fun(int)" <<endl;
|
|
}
|
|
void fun(double) {
|
|
cout
<<"base::fun(double)" <<endl;
|
|
}
|
|
};
|
|
|
class
derived : public base {
|
|
public:
|
|
using base::fun; //fun(int) & fun(double) now in
scope
|
void fun(int) { //hides fun(int) brought into scope
|
|
cout
<<"derived::fun(int)" <<endl;
|
|
}
|
|
void fun(char*) { //defines new
fun(char*)
|
|
cout
<<"derived::fun(char*)" <<endl;
|
|
}
|
|
};
|
|