Description
Track allocated resources.
Description
When the scope of a bracket
doesn't enclose all uses of the resource, a ResourceRegistry
can be used instead to capture the lifetime of those resources.
README.md
resource-registry
In some cases, the lifetime of a resource is not suitable for CPS and hence can't use bracket
-like functions, for example, the resource might be tracked inside some other data structure. In this case, the container data structure can be allocated in a resource registry together with the resources so that an exception will deallocate the resources in a proper order.