diff --git a/src/util/IntrusiveList.hxx b/src/util/IntrusiveList.hxx index 58e563b65..570440b38 100644 --- a/src/util/IntrusiveList.hxx +++ b/src/util/IntrusiveList.hxx @@ -140,18 +140,9 @@ struct IntrusiveListBaseHookTraits { return static_cast(hook); } - static constexpr const T *Cast(const IntrusiveListNode *node) noexcept { - const auto *hook = &Hook::Cast(*node); - return static_cast(hook); - } - static constexpr auto &ToHook(T &t) noexcept { return static_cast &>(t); } - - static constexpr const auto &ToHook(const T &t) noexcept { - return static_cast &>(t); - } }; /** @@ -172,18 +163,9 @@ struct IntrusiveListMemberHookTraits { return &ContainerCast(hook, member); } - static constexpr const T *Cast(const IntrusiveListNode *node) noexcept { - const auto &hook = Hook::Cast(*node); - return &ContainerCast(hook, member); - } - static constexpr auto &ToHook(T &t) noexcept { return t.*member; } - - static constexpr const auto &ToHook(const T &t) noexcept { - return t.*member; - } }; /** @@ -207,7 +189,7 @@ class IntrusiveList { } static constexpr const T *Cast(const IntrusiveListNode *node) noexcept { - return HookTraits::Cast(node); + return HookTraits::Cast(const_cast(node)); } static constexpr auto &ToHook(T &t) noexcept {