4#ifndef FTXUI_UTIL_AUTORESET_HPP
5#define FTXUI_UTIL_AUTORESET_HPP
16 : variable_(variable), previous_value_(std::move(*variable)) {
17 *variable_ = std::move(new_value);
19 ~AutoReset() { *variable_ = std::move(previous_value_); }
Assign a value to a variable, reset its old value when going out of scope.
AutoReset(T *variable, T new_value)