From c3b7c6999fc489849d5151ed4aaf678615f90dde Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Sat, 24 Aug 2013 21:49:01 -0400 Subject: [PATCH] Implemented decrement and distance_to for LLInstanceTracker::instance_iter and LLInstanceTracker::key_iter Technically, both nested iterator classes in llinstance tracker should be derived from a common base implementation of boost::iterator_facade for std::maps(LLInstanceTracker::InstanceMap), they'd only need to implement dereference individually --- indra/llcommon/llinstancetracker.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/indra/llcommon/llinstancetracker.h b/indra/llcommon/llinstancetracker.h index ecaf55586..3c096abe1 100644 --- a/indra/llcommon/llinstancetracker.h +++ b/indra/llcommon/llinstancetracker.h @@ -86,6 +86,7 @@ class LLInstanceTracker : public LLInstanceTrackerBase { typedef LLInstanceTracker MyT; typedef typename std::map InstanceMap; + typedef typename InstanceMap::iterator::difference_type difference_type; struct StaticData: public StaticBase { InstanceMap sMap; @@ -115,6 +116,11 @@ public: friend class boost::iterator_core_access; void increment() { mIterator++; } + void decrement() { --mIterator; } + difference_type distance_to(instance_iter const& other) const + { + return std::distance(mIterator, other.mIterator); + } bool equal(instance_iter const& other) const { return mIterator == other.mIterator; @@ -155,6 +161,11 @@ public: friend class boost::iterator_core_access; void increment() { mIterator++; } + void decrement() { --mIterator; } + difference_type distance_to(instance_iter const& other) const + { + return std::distance(mIterator, other.mIterator); + } bool equal(key_iter const& other) const { return mIterator == other.mIterator;