Precautions also in TrackIterRange::StaringWith() as in EndingAfter()
This commit is contained in:
parent
74a360f682
commit
26abe0255d
13
src/Track.h
13
src/Track.h
|
@ -980,7 +980,8 @@ private:
|
|||
return !this->mPred || this->mPred( pTrack );
|
||||
}
|
||||
|
||||
// This friendship is needed in TrackIterRange::EndingAfter()
|
||||
// This friendship is needed in TrackIterRange::StartingWith and
|
||||
// TrackIterRange::EndingAfter()
|
||||
friend TrackIterRange< TrackType >;
|
||||
|
||||
// The class invariant is that mIter == mEnd, or else, mIter != mEnd and
|
||||
|
@ -1057,9 +1058,15 @@ template <
|
|||
|
||||
TrackIterRange StartingWith( const Track *pTrack ) const
|
||||
{
|
||||
auto newBegin = this->find( pTrack );
|
||||
// More careful construction is needed so that the independent
|
||||
// increment and decrement of each iterator in the NEW pair
|
||||
// has the expected behavior at boundaries of the range
|
||||
return {
|
||||
this->find( pTrack ),
|
||||
this->second
|
||||
{ newBegin.mIter, newBegin.mIter, this->second.mEnd,
|
||||
this->first.GetPredicate() },
|
||||
{ newBegin.mIter, this->second.mEnd, this->second.mEnd,
|
||||
this->second.GetPredicate() }
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue