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:
Mathew Sutcliffe
2014-01-28 18:25:14 +00:00
parent d073681630
commit 1e153b45f0
5 changed files with 35 additions and 16 deletions

View File

@@ -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();
}
/*!