util/IntrusiveHashSet: add missing Cast()/ToHook() functions to IntrusiveHashSetMemberHookTraits

This commit is contained in:
Max Kellermann 2022-12-01 10:54:33 +01:00 committed by Max Kellermann
parent fe3e1d31bf
commit 5945877313
1 changed files with 8 additions and 0 deletions

View File

@ -85,6 +85,14 @@ struct IntrusiveHashSetMemberHookTraits {
template<typename Dummy>
using Hook = _Hook;
static constexpr T *Cast(Hook<T> *node) noexcept {
return &ContainerCast(*node, member);
}
static constexpr auto &ToHook(T &t) noexcept {
return t.*member;
}
};
/**