, ( ) 2 :
API, / .
But the first element is where C ++ really shines and language support for constructors / destructors (the heart of RAII). It is the fact that constructors and destructors are invoked through code that is automatically inserted by the compiler into the correct places that make the magic work. Without the native language support for CTOR and DTOR, you will simply approximate the effect or rely on the user to "do the right thing" when necessary.
source
share