mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-25 09:30:35 +00:00
rogueviz:: rv_keep
This commit is contained in:
parent
b2668e4cf5
commit
572866b67a
@ -133,6 +133,11 @@ namespace rogueviz {
|
||||
on_cleanup_or_next([backup, &variable] { variable = backup; });
|
||||
}
|
||||
|
||||
template<class T> void rv_keep(T& variable) {
|
||||
T backup = variable;
|
||||
on_cleanup_or_next([backup, &variable] { variable = backup; });
|
||||
}
|
||||
|
||||
template<class T, class U> void rv_hook(hookset<T>& m, int prio, U&& hook) {
|
||||
int p = addHook(m, prio, hook);
|
||||
auto del = [&m, p] {
|
||||
|
Loading…
Reference in New Issue
Block a user