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
Yes. Struct can inherit from a class and vice versa. The accessibility rule is
$11.2/2- "In the absence of an access-specifier for a base class, public is assumed when the derived class is declared struct and private is assumed when the class is declared class."
EDIT 2: So you can change your class as:. Note that it is a bad idea to have public data members usually.
class user_messages { // i also changed the name when OP was modified :)
public:
std::list messages;
};