Bug 1174583: P1. Add iterators to IntervalSet. r=mattwoodrow

Make for more elegant loops.
This commit is contained in:
Jean-Yves Avenard 2015-06-15 11:48:47 +10:00
parent 4f89d96033
commit 27b85119f2

View File

@ -609,6 +609,27 @@ public:
return NoIndex;
}
// Methods for range-based for loops.
typename ContainerType::iterator begin()
{
return mIntervals.begin();
}
typename ContainerType::const_iterator begin() const
{
return mIntervals.begin();
}
typename ContainerType::iterator end()
{
return mIntervals.end();
}
typename ContainerType::const_iterator end() const
{
return mIntervals.end();
}
protected:
ContainerType mIntervals;