RTGroup 2: App: add PropertyListsT::removeIf() (#26173)
* App: add PropertyListsT::removeIf() For convenient list value filtering. Co-authored-by: Zheng Lei <[email protected]> * Update Property.h * Update Property.h
This commit is contained in:
@@ -1097,6 +1097,16 @@ public:
|
||||
guard.tryInvoke();
|
||||
}
|
||||
|
||||
template<std::predicate<const T&> F>
|
||||
int removeIf(F f) {
|
||||
ListT vals = _lValueList;
|
||||
size_t removed = std::erase_if(vals, f);
|
||||
if (removed > 0) {
|
||||
setValues(std::move(vals));
|
||||
}
|
||||
return static_cast<int>(removed);
|
||||
}
|
||||
|
||||
protected:
|
||||
void setPyValues(const std::vector<PyObject*>& vals, const std::vector<int>& indices) override
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user