mirror of
https://github.com/MaskRay/ccls.git
synced 2025-01-20 04:22:32 +00:00
18 lines
196 B
C++
18 lines
196 B
C++
struct Parent {
|
|
virtual void Method() = 0;
|
|
};
|
|
struct Derived : public Parent {
|
|
void Method() override {}
|
|
};
|
|
|
|
|
|
void Caller() {
|
|
Derived d;
|
|
Parent* p = &d;
|
|
|
|
p->Method();
|
|
d->Method();
|
|
}
|
|
|
|
|