chsvlib
chsv helper source code

◆ AutoResource() [19/28]

AutoResource ( checker_rref  rrefChecker)

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

Parameters
rrefCheckeris an rvalue reference to a checker object to be used to check if a managed handle is allowed to be closed by the closer.
Remarks
The created object is empty (owns nothing), with value-initialized stored handle and closer. The default handle is not to be closed.
The only handles closed are the ones which are allowed to be closed by the checker.
Warning
The checker callable object must not allow the closing of the default constructed handle (i.e. handle_type()).