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

@@ -152,7 +152,7 @@ namespace BlackMisc
virtual PimplBase *clone() const { return new Pimpl(*this); }
virtual const_reference operator *() const { return *m_impl; }
virtual void operator ++() { ++m_impl; }
virtual void operator +=(difference_type n) { m_impl += n; }
virtual void operator +=(difference_type n) { std::advance(m_impl, n); }
virtual bool operator ==(const PimplBase &other) const { return m_impl == static_cast<const Pimpl&>(other).m_impl; }
virtual void *impl() { return &m_impl; }
private: