diff --git a/src/common/objects/dobjgc.h b/src/common/objects/dobjgc.h index f5514255db..280c86273f 100644 --- a/src/common/objects/dobjgc.h +++ b/src/common/objects/dobjgc.h @@ -215,6 +215,9 @@ class TObjPtr mutable DObject *o; }; public: + TObjPtr() = default; + + TObjPtr(T t) : pp(t) {} constexpr TObjPtr& operator=(T q) noexcept { diff --git a/src/common/utility/tarray.h b/src/common/utility/tarray.h index f849e9cca5..b642f3c87e 100644 --- a/src/common/utility/tarray.h +++ b/src/common/utility/tarray.h @@ -576,6 +576,35 @@ public: return f; } + bool SortedDelete(const T& obj) + { + auto f = SortedFind(obj, true); + if (f == Size()) + { + Delete(f); + return true; + } + else + { + return false; + } + } + + template + bool SortedDelete(const T& obj, Func lt) + { + auto f = SortedFind(obj, lt, true); + if (f == Size()) + { + Delete(f); + return true; + } + else + { + return false; + } + } + bool Pop () { if (Count > 0)