mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 07:35:48 +08:00
moved removeIf from CContainerBase to CSequence because it can't work with non-sequential containers, fixes #106
This commit is contained in:
@@ -105,26 +105,6 @@ namespace BlackMisc
|
||||
return contains(BlackMisc::Predicates::MemberEqual<T>(key1, value1));
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Remove elements for which a given predicate returns true.
|
||||
*/
|
||||
template <class Predicate>
|
||||
void removeIf(Predicate p)
|
||||
{
|
||||
std::remove_if(derived().begin(), derived().end(), p);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Remove elements matching a particular key/value pair.
|
||||
* \param key1 A pointer to a member function of T.
|
||||
* \param value1 Will be compared to the return value of key1.
|
||||
*/
|
||||
template <class K1, class V1>
|
||||
void removeIf(K1 key1, V1 value1)
|
||||
{
|
||||
removeIf(BlackMisc::Predicates::MemberEqual<T>(key1, value1));
|
||||
}
|
||||
|
||||
public: // CValueObject overrides
|
||||
/*!
|
||||
* \copydoc CValueObject::toQVariant()
|
||||
|
||||
Reference in New Issue
Block a user