termstyle 1.0.0-pre.3
An open-source C++ header file that enables developers to easily define and apply customizable style presets for terminal outputs such as warnings, infos, and errors.
|
The OnExit
class is a helper class that performs an action when it goes out of scope.
More...
#include <termstyle.hpp>
Public Member Functions | |
~OnExit () | |
Destructor for the OnExit class. | |
The OnExit
class is a helper class that performs an action when it goes out of scope.
This class is designed to be used with the RAII (Resource Acquisition Is Initialization) idiom. When an object of the OnExit
class is created, it performs the specified action in its destructor when it goes out of scope, regardless of how the scope is exited (e.g., normal exit, exception, etc.).
In this specific implementation, the OnExit
class is used to restore the terminal style by printing the restore code when the object goes out of scope.
|
inline |