Commit 78670c09 authored by Max Kellermann's avatar Max Kellermann

util/IntrusiveList: add `constexpr`

parent 34f73589
...@@ -125,7 +125,7 @@ class IntrusiveList { ...@@ -125,7 +125,7 @@ class IntrusiveList {
} }
public: public:
IntrusiveList() noexcept = default; constexpr IntrusiveList() noexcept = default;
IntrusiveList(IntrusiveList &&src) noexcept { IntrusiveList(IntrusiveList &&src) noexcept {
if (src.empty()) if (src.empty())
...@@ -140,7 +140,7 @@ public: ...@@ -140,7 +140,7 @@ public:
} }
~IntrusiveList() noexcept { ~IntrusiveList() noexcept {
if (std::is_base_of<AutoUnlinkIntrusiveListHook, T>::value) if constexpr (std::is_base_of<AutoUnlinkIntrusiveListHook, T>::value)
clear(); clear();
} }
...@@ -151,7 +151,7 @@ public: ...@@ -151,7 +151,7 @@ public:
} }
void clear() noexcept { void clear() noexcept {
if (std::is_base_of<AutoUnlinkIntrusiveListHook, T>::value) { if constexpr (std::is_base_of<AutoUnlinkIntrusiveListHook, T>::value) {
/* for AutoUnlinkIntrusiveListHook, we need to /* for AutoUnlinkIntrusiveListHook, we need to
remove each item manually, or else its remove each item manually, or else its
is_linked() method will not work */ is_linked() method will not work */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment