util: add compile-time validation tests for intrusive red black trees
This commit is contained in:
@@ -550,7 +550,7 @@ namespace ams::util {
|
||||
constexpr ALWAYS_INLINE const Derived *GetNext() const { return static_cast<const Derived *>(impl::IntrusiveRedBlackTreeImpl::GetNext(this)); }
|
||||
};
|
||||
|
||||
template<class Derived>
|
||||
template<class Derived> requires std::derived_from<Derived, IntrusiveRedBlackTreeNode>
|
||||
class IntrusiveRedBlackTreeBaseTraits {
|
||||
public:
|
||||
template<class Comparator>
|
||||
|
||||
@@ -30,10 +30,10 @@ namespace ams::util {
|
||||
bool active;
|
||||
public:
|
||||
constexpr ALWAYS_INLINE ScopeGuard(F f) : f(std::move(f)), active(true) { }
|
||||
ALWAYS_INLINE ~ScopeGuard() { if (active) { f(); } }
|
||||
ALWAYS_INLINE void Cancel() { active = false; }
|
||||
constexpr ALWAYS_INLINE ~ScopeGuard() { if (active) { f(); } }
|
||||
constexpr ALWAYS_INLINE void Cancel() { active = false; }
|
||||
|
||||
ALWAYS_INLINE ScopeGuard(ScopeGuard&& rhs) : f(std::move(rhs.f)), active(rhs.active) {
|
||||
constexpr ALWAYS_INLINE ScopeGuard(ScopeGuard&& rhs) : f(std::move(rhs.f)), active(rhs.active) {
|
||||
rhs.Cancel();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user