Skip to content
Snippets Groups Projects
Commit 5108a78d authored by Bhuvan Bezawada's avatar Bhuvan Bezawada
Browse files

Changed iterator to be a random access iterator

re #23145
parent f615296f
No related branches found
No related tags found
No related merge requests found
...@@ -45,7 +45,7 @@ Code Documentation is available at: <http://doxygen.mantidproject.org> ...@@ -45,7 +45,7 @@ Code Documentation is available at: <http://doxygen.mantidproject.org>
class MANTID_GEOMETRY_DLL DetectorInfoIterator class MANTID_GEOMETRY_DLL DetectorInfoIterator
: public boost::iterator_facade<DetectorInfoIterator, : public boost::iterator_facade<DetectorInfoIterator,
const DetectorInfoItem &, const DetectorInfoItem &,
boost::bidirectional_traversal_tag> { boost::random_access_traversal_tag> {
public: public:
DetectorInfoIterator(const DetectorInfo &detectorInfo, const size_t index) DetectorInfoIterator(const DetectorInfo &detectorInfo, const size_t index)
......
...@@ -151,8 +151,8 @@ public: ...@@ -151,8 +151,8 @@ public:
std::advance(iter, -2); std::advance(iter, -2);
TS_ASSERT_EQUALS(iter->getIndex(), 9); TS_ASSERT_EQUALS(iter->getIndex(), 9);
// Go past the start // Go to the start
std::advance(iter, -100); std::advance(iter, -9);
TS_ASSERT(iter == detectorInfo->begin()); TS_ASSERT(iter == detectorInfo->begin());
} }
......
...@@ -26,7 +26,7 @@ using namespace boost::python; ...@@ -26,7 +26,7 @@ using namespace boost::python;
// Helper method to make the python iterator // Helper method to make the python iterator
DetectorInfoPythonIterator make_pyiterator(const DetectorInfo &detectorInfo) { DetectorInfoPythonIterator make_pyiterator(const DetectorInfo &detectorInfo) {
return DetectorInfoPythonIterator(detectorInfo); return DetectorInfoPythonIterator(detectorInfo);
}; }
// Export DetectorInfo // Export DetectorInfo
void export_DetectorInfo() { void export_DetectorInfo() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment