I am looking at the implementation of an API that I am using.
I noticed that a struct is inheriting from a class and I paused to ponder on it...
First, I d
The only difference between a struct and a class is the default access level for members (private for classes, public for structs). This means that a struct should be able to inherit from a class, and vice-versa.
However, there is usually a difference in how structs and classes are used that is not mandated by the standard. structs are often used for pure data, ( or objects without polymorphism depending on your projects preference) and classes are used for the other cases. I emphasise that this is just a stylistic difference and not required.