Sorry if the question is silly. I come from java background.
In the following code, base_list is a parent class of SqlAloc, but what’s the meaning of public memory?
class base_list :public memory::SqlAlloc
{
protected:
list_node *first,**last;
uint32_t elements;
public:
};
Memoryis probably a namespace (kind of like an outer class) in whichSqlAllocis defined.C++ has both
publicandprivateinheritance (protected, too, actually.)publicinheritance is just like Java inheritance; inprivateinheritance, though, code outside the derived class doesn’t know about the base class. It’s a way to inherit implementation without inheriting type. In Java, you can only do both.