/
githubmirror
/
CPlusPlusThings
Обзор
Документация
Войти
/
githubmirror
/
CPlusPlusThings
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
basic_content/using/using_derived.cpp
29 строк
443 B
zhangxing
support bazel complie this project and format code.
30 мар 2024, 17:00
30 мар 2024, 17:00
3c8a3f2
Код
Авторство
О чём код?
/** * @file using_derived.cpp * @brief 函数重装 * @author 光城 * @version v1 * @date 2019-08-07 */ #include <iostream> using namespace std; class Base { public: void f() { cout << "f()" << endl; } void f(int n) { cout << "Base::f(int)" << endl; } }; class Derived : private Base { public: using Base::f; void f(int n) { cout << "Derived::f(int)" << endl; } }; int main() { Derived d; d.f(); d.f(1); return 0; }