| Version: 3.0.5

- Main Page
- Related Pages
- Categories
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | List of all members
wxScopeGuard Class Reference
Class List by Category » Miscellaneous

`#include <wx/scopeguard.h>`

## Detailed Description

Scope guard is an object which allows executing an action on scope exit.

The objects of this class must be constructed using wxMakeGuard() function.

##

Library: None; this class implementation is entirely header-based.
Category: Miscellaneous

## Public Member Functions

void | Dismiss ()
| Call this method to dismiss the execution of the action on scope exit. More...

## Member Function Documentation

void wxScopeGuard::Dismiss | ( |  | ) |

Call this method to dismiss the execution of the action on scope exit.

A typical example:

Update1();
// ensure that changes done so far are rolled back if the next
// operation throws
wxScopeGuard guard = wxMakeGuard(RollBack);
Update2();
// it didn't throw so commit the changes, i.e. avoid rolling back
guard.Dismiss();