chsvlib
chsv helper source code

◆ AutoResource() [5/28]

AutoResource ( handle_lref  refHandle,
closer_lref  refCloser 
)

Constructs an AutoResource object from an lvalue handle and an lvalue closer object, with the default checker object.

Parameters
refHandleis an lvalue reference to a resource handle which is to be owned and managed by the created object.
refCloseris an lvalue reference to a closer object to be used for closing handles owned and managed by the created instance of the AutoResource.
Remarks
The object takes ownership of the handle, initializing its stored handle and closer and value-initializing its stored checker.
The only handles closed are the ones which are allowed to be closed by the checker.