A destructor, ~ClassName(), runs automatically when an object's lifetime ends: at the closing brace of its scope, when a function returns early, and when an exception passes through. C++ code uses this to tie a resource to an object: the constructor acquires it and the destructor releases it. The pattern is called RAII (resource acquisition is initialization), and it is how std::vector frees its memory, how std::lock_guard releases a mutex and how std::ofstream closes a file.
With RAII there is no close() call to forget on some path. A function with three return statements and a throw releases the resource on all four, because every path leaves the scope.
An object that owns a resource usually must not be copied: two copies would release the same handle twice. Delete the copy operations with = delete, and the compiler refuses any copy. In these exercises the tests provide open_feed(), close_feed(h) and feeds_open(), a pretend handle API that counts what is still open.
Acquire in the constructor, release in the destructor, and forbid copies.