Translations:Demystifying C++ - Classes/14/en
Jump to navigation
Jump to search
In C, there's no direct counterpart for constructors and destructors. Instead, they are replaced by regular functions that are called upon object creation or destruction. For completeness, it should be mentioned that for the Itanium ABI, at least two constructor functions (ctor_complete
, ctor_base
) and destructor functions (dtor_complete
, dtor_base
, dtor_delete
) are generated. The complete variants are typically used, base variants are required for base classes in the constructor/destructor, and dtor_delete
is used when applying delete to a class with a virtual destructor.