diff options
author | Max Kellermann <max@musicpd.org> | 2021-02-24 20:16:18 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2021-02-24 20:16:54 +0100 |
commit | 78670c0941f22438ff75835970da354bb2f61c73 (patch) | |
tree | 9b87250c7afe4d4e4516108cfc60996d3a4f0b5c /src/util | |
parent | 34f735890eaa997e395c6706df7e35a9dc8c5378 (diff) |
util/IntrusiveList: add `constexpr`
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/IntrusiveList.hxx | 6 |
1 files 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<AutoUnlinkIntrusiveListHook, T>::value) + if constexpr (std::is_base_of<AutoUnlinkIntrusiveListHook, T>::value) clear(); } @@ -151,7 +151,7 @@ public: } 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 remove each item manually, or else its is_linked() method will not work */ |