chsvlib
chsv helper source code

◆ AutoResource() [9/28]

AutoResource ( handle_rref  rrefHandle,
closer_rref  rrefCloser 
)

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

Parameters
rrefHandleis an rvalue reference to a resource handle which is to be owned and managed by the created object.
rrefCloseris an rvalue 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.