Constructs an AutoResource object from lvalue references to a closer and checker used to close a managed handle and to check allowance for closing respectively. The handle is value-initialized.
- Parameters
-
refCloser | is an lvalue reference to a closer object to be used for closing handles owned and managed by the created instance of the AutoResource. |
refChecker | is 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. |
- Warning
- The checker callable object must not allow the closing of the default constructed handle (i.e. handle_type()).