mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-26 10:00:42 +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; });
|
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) {
|
template<class T, class U> void rv_hook(hookset<T>& m, int prio, U&& hook) {
|
||||||
int p = addHook(m, prio, hook);
|
int p = addHook(m, prio, hook);
|
||||||
auto del = [&m, p] {
|
auto del = [&m, p] {
|
||||||
|
Loading…
Reference in New Issue
Block a user