PStack  2.0
Stack trace printer for MSVC and GCC binaries
psystem::default_close_handle< T > Struct Template Referencefinal

A simple functor to close handles (for use with RAII handle containers). More...

#include <default_close_handle.hpp>

Public Member Functions

void operator() (T hndl) const noexcept
 Executes a handle clean-up routine. More...
 

Static Public Member Functions

static void close_handle (T hndl) noexcept
 Executes a handle clean-up routine without requiring an instance. More...
 

Detailed Description

template<typename T>
struct psystem::default_close_handle< T >

A simple functor to close handles (for use with RAII handle containers).

This class is marked final because the interfaces that use it make optimizations that become impossible if the class can be derived. For example, an unique_handle may specify this as a deleter in the template parameter, which would case the class to not store a deleter at runtime, but if default_close_handle were derivable, the caller could (rightfully) pass an instance of the derived class, which would be ignored.

Template Parameters
TThe handle type.
See also
psystem::shared_handle
psystem::unique_handle
Todo:
Examine the return value from CloseHandle().
Author
Matt Bisson
Date
5 August, 2014
Since
PSystem 2.0
Version
PSystem 2.0

Member Function Documentation

template<typename T>
static void psystem::default_close_handle< T >::close_handle ( hndl)
inlinestaticnoexcept

Executes a handle clean-up routine without requiring an instance.

Parameters
[in]hndlThe handle to clean up.
Todo:
Log if the result is not a success.
template<typename T>
void psystem::default_close_handle< T >::operator() ( hndl) const
inlinenoexcept

Executes a handle clean-up routine.

Parameters
[in]hndlThe handle to clean up.

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