diff --git a/Framework/Geometry/inc/MantidGeometry/Instrument/InfoIteratorBase.h b/Framework/Geometry/inc/MantidGeometry/Instrument/InfoIteratorBase.h index eccc9ef0de9ff5870a5d3ba887d03f8a56d3643d..c31f398f3800b5687d2761466ffc189172e20a8e 100644 --- a/Framework/Geometry/inc/MantidGeometry/Instrument/InfoIteratorBase.h +++ b/Framework/Geometry/inc/MantidGeometry/Instrument/InfoIteratorBase.h @@ -20,9 +20,9 @@ via a random access iterator. */ template <typename T, template <typename> class InfoItem> class InfoIteratorBase - : public boost::iterator_facade<InfoIteratorBase<T, InfoItem>, - InfoItem<T> &, - boost::random_access_traversal_tag> { + : public boost::iterator_facade<InfoIteratorBase<T, InfoItem>, InfoItem<T>, + boost::random_access_traversal_tag, + InfoItem<T>> { public: InfoIteratorBase(T &info, const size_t index) : m_item(info, index) {} @@ -59,14 +59,14 @@ private: return getIndex() == other.getIndex(); } - InfoItem<T> &dereference() const { return m_item; } + InfoItem<T> dereference() const { return m_item; } uint64_t distance_to(const InfoIteratorBase<T, InfoItem> &other) const { return static_cast<uint64_t>(other.getIndex()) - static_cast<uint64_t>(getIndex()); } - mutable InfoItem<T> m_item; + InfoItem<T> m_item; }; } // namespace Geometry } // namespace Mantid diff --git a/Framework/PythonInterface/inc/MantidPythonInterface/api/ComponentInfoPythonIterator.h b/Framework/PythonInterface/inc/MantidPythonInterface/api/ComponentInfoPythonIterator.h index 1d36409127749a125a63b40f0fbaf3593d1ecca7..e1cc280bf4e2339b6ee7cb0b9d0af83ca739994c 100644 --- a/Framework/PythonInterface/inc/MantidPythonInterface/api/ComponentInfoPythonIterator.h +++ b/Framework/PythonInterface/inc/MantidPythonInterface/api/ComponentInfoPythonIterator.h @@ -33,7 +33,7 @@ public: : m_begin(detectorInfo.begin()), m_end(detectorInfo.end()), m_firstOrDone(true) {} - const ComponentInfoItem<ComponentInfo> &next() { + ComponentInfoItem<ComponentInfo> next() { if (!m_firstOrDone) ++m_begin; else diff --git a/Framework/PythonInterface/inc/MantidPythonInterface/api/DetectorInfoPythonIterator.h b/Framework/PythonInterface/inc/MantidPythonInterface/api/DetectorInfoPythonIterator.h index ee194aaaa3ef3a5aa5332263cead2f8c3fe64e1a..42c10470115f524c45e8e5c5b70a513c7dafbdca 100644 --- a/Framework/PythonInterface/inc/MantidPythonInterface/api/DetectorInfoPythonIterator.h +++ b/Framework/PythonInterface/inc/MantidPythonInterface/api/DetectorInfoPythonIterator.h @@ -42,7 +42,7 @@ public: : m_begin(detectorInfo.begin()), m_end(detectorInfo.end()), m_firstOrDone(true) {} - const DetectorInfoItem<DetectorInfo> &next() { + DetectorInfoItem<DetectorInfo> next() { if (!m_firstOrDone) ++m_begin; else diff --git a/Framework/PythonInterface/mantid/geometry/src/Exports/ComponentInfoPythonIterator.cpp b/Framework/PythonInterface/mantid/geometry/src/Exports/ComponentInfoPythonIterator.cpp index 8481f68b5bd72527a8560ba74f8773d09390d1d7..3a967c61759e2608bd2b54b326cba261daa723fd 100644 --- a/Framework/PythonInterface/mantid/geometry/src/Exports/ComponentInfoPythonIterator.cpp +++ b/Framework/PythonInterface/mantid/geometry/src/Exports/ComponentInfoPythonIterator.cpp @@ -5,9 +5,8 @@ // & Institut Laue - Langevin // SPDX - License - Identifier: GPL - 3.0 + #include "MantidPythonInterface/api/ComponentInfoPythonIterator.h" - +#include "MantidPythonInterface/core/VersionCompat.h" #include <boost/python/class.hpp> -#include <boost/python/copy_const_reference.hpp> #include <boost/python/iterator.hpp> #include <boost/python/module.hpp> @@ -23,8 +22,7 @@ void export_ComponentInfoPythonIterator() { #ifdef IS_PY3K .def("__next__", &ComponentInfoPythonIterator::next) #else - .def("next", &ComponentInfoPythonIterator::next, - return_value_policy<copy_const_reference>()) + .def("next", &ComponentInfoPythonIterator::next) #endif ; /* diff --git a/Framework/PythonInterface/mantid/geometry/src/Exports/DetectorInfoPythonIterator.cpp b/Framework/PythonInterface/mantid/geometry/src/Exports/DetectorInfoPythonIterator.cpp index 68816097784342fecfe4ce00fa99cde4ca8cdbc8..060495bf825ca053f442d823e6b1c932195020fb 100644 --- a/Framework/PythonInterface/mantid/geometry/src/Exports/DetectorInfoPythonIterator.cpp +++ b/Framework/PythonInterface/mantid/geometry/src/Exports/DetectorInfoPythonIterator.cpp @@ -7,7 +7,6 @@ #include "MantidPythonInterface/api/DetectorInfoPythonIterator.h" #include "MantidPythonInterface/core/VersionCompat.h" #include <boost/python/class.hpp> -#include <boost/python/copy_const_reference.hpp> #include <boost/python/iterator.hpp> #include <boost/python/module.hpp> @@ -23,8 +22,7 @@ void export_DetectorInfoPythonIterator() { #ifdef IS_PY3K .def("__next__", &DetectorInfoPythonIterator::next) #else - .def("next", &DetectorInfoPythonIterator::next, - return_value_policy<copy_const_reference>()) + .def("next", &DetectorInfoPythonIterator::next) #endif ; /*