chsvlib
chsv helper source code
check_handle_t< unclosable_handle_t_n > Struct Template Reference

A function object of a class template that allows specifying values, a handle to be checked against by the supplied parenthesis operator, which returns true only if the specified (as its only argument) handle is not equal to any of the template parameters. More...

Detailed Description

template<class... unclosable_handle_t_n>
struct Chusov::Win32::Memory::check_handle_t< unclosable_handle_t_n >

A function object of a class template that allows specifying values, a handle to be checked against by the supplied parenthesis operator, which returns true only if the specified (as its only argument) handle is not equal to any of the template parameters.

Template Parameters
unclosable_handle_t_nis a set of template type parameters with a value static data member, against which the handle passed to the parenthesis operator is checked. See invalid_handle_value_t and null_handle_value_t for examples of valid types for the template parameter.

Example:

check_handle_t<invalid_handle_value_t chckFile;
check_handle_t<null_handle_value_t> chckHeap;
HANDLE hFile = CreateFile(path, access, share, security, disposition, attributes, template_file);
if (!chckFile(hFile))
exit(-1); //hFile == INVALID_HANDLE_VALUE
HANDLE hHeap = HeapCreate(0, 0x1000, 0);
if (!chckHeap(hHeap))
exit(-2); //hHeap == NULL
See also
Chusov::Memory::AutoResource
AutoFile

The documentation for this struct was generated from the following file: