diff --git a/hyper.h b/hyper.h index 5a2c28c5..1959dd2f 100644 --- a/hyper.h +++ b/hyper.h @@ -458,9 +458,13 @@ public: prio++; } map_->emplace(prio, static_cast(hook)); - return 0; + return prio; } + void del(int prio) { + map_->erase(prio); + } + template void callhooks(U&&... args) const { if (map_ == nullptr) return; @@ -709,6 +713,10 @@ template int addHook(hookset& m, int prio, U&& hook) { return m.add(prio, static_cast(hook)); } +template void delHook(hookset& m, int prio) { + m.del(prio); + } + template void callhooks(const hookset& h, U&&... args) { return h.callhooks(static_cast(args)...); }