Under the hood, there is no difference between composing two classes and having one class inherit from the other. To wit:
Originally Posted by manasij7479
The Derived struct is composing two things: a Base and an integer. But imagine that there is some syntactic sugar present, which allows us to avoid needing to put ".base." when we want to reference a member of Base. Suddenly you have inheritance. It's actually no different from composition, but the sugar gives us the feeling that Derived is actually just a specialized form of Base.
Once again, OOP is primarily in your head.