It is a technique in C++ language where resource use is bounded to the lifetime of the objects with automatic duration (non-dynamically allocated objects). This is implemented using class constructors and destructors where resources is acquired when constructor creates the object and resource is released in destructor.
For example:
class Items
{
int *arr{};
public:
Items()
{
std::cout << "Allocating resources\n";
arr = new int[5];
}
~Items()
{
std::cout << "Releasing resources\n";
delete arr;
}
};