util/IntrusiveList: add constexpr
This commit is contained in:
parent
34f735890e
commit
78670c0941
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user