Skip to content

Commit

Permalink
feat: Improvements to multitrajectory iterators (#3619)
Browse files Browse the repository at this point in the history
This small PR adds an post-increment operator to the multitrajectory iterator, as well as `cbegin` and `cend` methods.
  • Loading branch information
stephenswat authored Sep 19, 2024
1 parent c334ce4 commit f4efc6f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Core/include/Acts/EventData/MultiTrajectory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ class TrackStateRange {
}
}

Iterator operator++(int) {
Iterator tmp(*this);
operator++();
return tmp;
}

bool operator==(const Iterator& other) const {
if (!proxy && !other.proxy) {
return true;
Expand All @@ -109,6 +115,9 @@ class TrackStateRange {
Iterator begin() { return m_begin; }
Iterator end() { return Iterator{std::nullopt}; }

Iterator cbegin() const { return m_begin; }
Iterator cend() const { return Iterator{std::nullopt}; }

private:
Iterator m_begin;
};
Expand Down

0 comments on commit f4efc6f

Please sign in to comment.