class A {
    public:
    void foo() {}
};

class B : A { // defaults to private inheritance
    public:
    void bar() {
        foo(); // can call foo() because it's public
    }
};

int main() {
    A* a;
    B b;
    a = &b; // cannot assign subtype, unless we inherit from A publicly
    b.bar();
    a->foo(); // doesn't exist, unless we inherit from A publicly
}
