A class defining functionality for automated management of Windows resources, described by the HANDLE
values, e.g. files, processes, tokens, etc.
More...
#include <chsvwinutilex.h>
Public Member Functions | |
operator bool () const | |
Returns whether a handle is currently managed by the AutoHandle object. | |
AutoHandle (HANDLE h=HANDLE()) noexcept | |
Constructs an AutoHandle object with an optional handle to be managed. More... | |
A class defining functionality for automated management of Windows resources, described by the HANDLE
values, e.g. files, processes, tokens, etc.
close_func_t | is a type of a pointer to a function, closing the acquired resources. A common value is decltype(&CloseHandle) . |
close_func | is a pointer to a closing function itself, such as CloseHandle. The function is not required to validate handle values, as it is performed by the class. |
invalid_handle_t_n | is a pack of types defining a value static data member of the HANDLE type. A managed handle equal to the value of any pack type is considered non-closable, i.e. if a managed handle equals to one of the values defined by the pack, the closing function is not called for the handle. |