# WinStd: winstd::last_error_saver Class Reference

Loading...
Searching...
No Matches
winstd::last_error_saver Class Reference
Exceptions

Saves GetLastError and restores SetLastError when going out of scope. More...

`#include <WinStd/Common.h>`

## Public Member Functions

| last_error_saver (DWORD error=GetLastError())
| Saves the calling thread's last-error code value.
| ~last_error_saver ()
| Sets the last-error code for the calling thread.

## Protected Attributes

DWORD | m_error

## Detailed Description

Saves GetLastError and restores SetLastError when going out of scope.

## Constructor & Destructor Documentation

## last_error_saver()

winstd::last_error_saver::last_error_saver | ( | DWORD | error = GetLastError() | ) |

inline

Saves the calling thread's last-error code value.

See also
  GetLastError function

## ~last_error_saver()

winstd::last_error_saver::~last_error_saver | ( |  | ) |

inline

Sets the last-error code for the calling thread.

See also
  SetLastError function

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

- include/WinStd/Common.h