33 template <
class KeyT,
class IterT,
class CompareT>
45 mIndexes(aEnd - aBegin),
49 while (aBegin != aEnd) {
50 mIndexes.push_back(aBegin++);
57 mIndexes.reserve(aEnd - aBegin);
58 while (aBegin != aEnd) {
59 mIndexes.push_back(aBegin++);
65 std::sort(mIndexes.begin(), mIndexes.end(), CompareT());
70 NS_ASSERTION(mSorted || mIndexes.empty(),
71 "sbIndex::find called without a call to sort");
76 if (iter != mIndexes.end() && !mCompareIter(aData, *iter)) {
79 return mIndexes.end();
83 NS_ASSERTION(mSorted || mIndexes.empty(),
84 "sbIndex::find called without a call to sort");
85 iterator const iter = std::lower_bound(mIndexes.begin(),
89 if (iter != mIndexes.end() && !mCompareIter(aData, *iter)) {
92 return mIndexes.end();
96 return mIndexes.begin();
100 return mIndexes.end();
104 return mIndexes.begin();
108 return mIndexes.end();
114 CompareT mCompareIter;
Indexes::iterator iterator
iterator find(KeyT const &aData)
sbIndex(IterT aBegin, IterT aEnd)
void Build(IterT aBegin, IterT aEnd)
const_iterator find(KeyT const &aData) const
std::vector< IterT > Indexes
const_iterator begin() const
const_iterator end() const
Indexes::const_iterator const_iterator
_updateTextAndScrollDataForFrame aData