One of the more basic and fundamental idioms of C++ programming is that of RAII. It’s so simple and fundamental that C++ seems to be the only programming language that supports this idiom. From Wikipedia, RAII is:
Resource Acquisition Is Initialization...