diff --git a/wpiutil/src/main/native/include/wpi/StringMap.h b/wpiutil/src/main/native/include/wpi/StringMap.h index a6b9375163..55e646518e 100644 --- a/wpiutil/src/main/native/include/wpi/StringMap.h +++ b/wpiutil/src/main/native/include/wpi/StringMap.h @@ -450,11 +450,24 @@ public: StringMapConstIterator tmp = *this; ++*this; return tmp; } + inline StringMapConstIterator& operator--() { // Predecrement + --Ptr; + ReversePastEmptyBuckets(); + return *this; + } + StringMapConstIterator operator--(int) { // Postdecrement + StringMapConstIterator tmp = *this; --*this; return tmp; + } + private: void AdvancePastEmptyBuckets() { while (*Ptr == nullptr || *Ptr == StringMapImpl::getTombstoneVal()) ++Ptr; } + void ReversePastEmptyBuckets() { + while (*Ptr == nullptr || *Ptr == StringMapImpl::getTombstoneVal()) + --Ptr; + } }; template