It calls the default constructor of the base class memory::SqlAlloc()
.
namespace memory {
class SqlAlloc
{
public:
SqlAlloc() {} // SqlAlloc's default constructor
};
}
//...
class base_list : public memory::SqlAlloc
{
public:
// base_list constructor
base_list(const base_list &tmp) : memory::SqlAlloc()
{
// The code after the ":" above and before the "{" brace
// is the initializer list
elements= tmp.elements;
first= tmp.first;
last= elements ? tmp.last : &first;
};
Consider the following:
int main()
{
base_list bl; // instance of base_list called "bl" is declared.
}
When bl
is created, it calls the constructor of base_list
. This causes the code in the initializer list of the base_list
constructor to run. That initializer list has memory::SqlAlloc()
, which calls SqlAlloc
's default constructor. When SqlAlloc
's constructor finishes, then the base_list
's constructor is run.