chsvlib
chsv helper source code

◆ AutoResource() [6/28]

AutoResource ( handle_rref  rrefHandle,
closer_lref  refCloser 
)

Constructs an AutoResource object from an rvalue reference to a handle, using move semantics, and from an lvalue closer, with the default checker.

Parameters
rrefHandleis an rvalue 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.