diff --git a/include/geometrycentral/utilities/element_iterators.h b/include/geometrycentral/utilities/element_iterators.h index 623e14cd..3e3b6a50 100644 --- a/include/geometrycentral/utilities/element_iterators.h +++ b/include/geometrycentral/utilities/element_iterators.h @@ -34,6 +34,8 @@ class RangeIteratorBase { RangeIteratorBase() = default; RangeIteratorBase(typename F::ParentMeshT* mesh_, size_t iStart_, size_t iEnd_); const RangeIteratorBase& operator++(); + RangeIteratorBase operator++(int); + bool operator==(const RangeIteratorBase& other) const; bool operator!=(const RangeIteratorBase& other) const; typename F::Etype operator*() const; diff --git a/include/geometrycentral/utilities/element_iterators.ipp b/include/geometrycentral/utilities/element_iterators.ipp index 19959051..50bec457 100644 --- a/include/geometrycentral/utilities/element_iterators.ipp +++ b/include/geometrycentral/utilities/element_iterators.ipp @@ -21,6 +21,13 @@ inline const RangeIteratorBase& RangeIteratorBase::operator++() { return *this; } +template +inline RangeIteratorBase RangeIteratorBase::operator++(int) { + RangeIteratorBase tmp = *this; + ++(*this); + return tmp; +} + template inline bool RangeIteratorBase::operator==(const RangeIteratorBase& other) const { return iCurr == other.iCurr;