mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-08 21:05:34 +08:00
refs #108, added find methods in CSequence and CCollection;
CSequence uses std::find, and CCollection uses the more efficient find method of the implementation type, which requires that the implementation type be an associative container like QSet or std::set. Modified CContainerBase::contains to use these new find methods.
This commit is contained in:
@@ -95,11 +95,11 @@ namespace BlackMisc
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Return true if there is an element equal to given object
|
||||
* \brief Return true if there is an element equal to given object. Uses the most efficient implementation available.
|
||||
*/
|
||||
bool contains(const T &object) const
|
||||
{
|
||||
return std::find(derived().begin(), derived().end(), object) != derived().end();
|
||||
return derived().find(object) != derived().end();
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
Reference in New Issue
Block a user