From 78670c0941f22438ff75835970da354bb2f61c73 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 24 Feb 2021 20:16:18 +0100 Subject: [PATCH] util/IntrusiveList: add `constexpr` --- src/util/IntrusiveList.hxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/IntrusiveList.hxx b/src/util/IntrusiveList.hxx index f38645539..c28e419d2 100644 --- a/src/util/IntrusiveList.hxx +++ b/src/util/IntrusiveList.hxx @@ -125,7 +125,7 @@ class IntrusiveList { } public: - IntrusiveList() noexcept = default; + constexpr IntrusiveList() noexcept = default; IntrusiveList(IntrusiveList &&src) noexcept { if (src.empty()) @@ -140,7 +140,7 @@ public: } ~IntrusiveList() noexcept { - if (std::is_base_of::value) + if constexpr (std::is_base_of::value) clear(); } @@ -151,7 +151,7 @@ public: } void clear() noexcept { - if (std::is_base_of::value) { + if constexpr (std::is_base_of::value) { /* for AutoUnlinkIntrusiveListHook, we need to remove each item manually, or else its is_linked() method will not work */