But you'll need to document it very visibly that "Thou shalt call resource.close() whatever happened."
C++ makes it possible for the library writer to take care of freeing the resources automatically.
C++ makes it possible for the library writer to take care of freeing the resources automatically.