chsvlib
chsv helper source code

◆ AutoResource() [10/28]

AutoResource ( checker_lref  refChecker)

Constructs an AutoResource object from the specified lvalue reference to a checker object, with the value-initialized default handle and the default closer object.

Parameters
refCheckeris an lvalue reference to a checker object to be used for checking if a handle managed by the instance of the AutoResource is allowed to be closed. The default class of checkers is a DefaultResourceHandleChecker.
Remarks
The created object is empty (owns nothing), with value-initialized stored handle and closer.
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()).