llvm.org GIT mirror llvm / da2fdcb
Fix begin() and end() on const IntervalMap. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121200 91177308-0d34-0410-b5e6-96231b3b80d8 Jakob Stoklund Olesen 9 years ago
1 changed file(s) with 5 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
11181118 friend class iterator;
11191119
11201120 const_iterator begin() const {
1121 iterator I(*this);
1121 const_iterator I(*this);
11221122 I.goToBegin();
11231123 return I;
11241124 }
11301130 }
11311131
11321132 const_iterator end() const {
1133 iterator I(*this);
1133 const_iterator I(*this);
11341134 I.goToEnd();
11351135 return I;
11361136 }
11441144 /// find - Return an iterator pointing to the first interval ending at or
11451145 /// after x, or end().
11461146 const_iterator find(KeyT x) const {
1147 iterator I(*this);
1147 const_iterator I(*this);
11481148 I.find(x);
11491149 return I;
11501150 }
13461346 // The path may be partially filled, but never between iterator calls.
13471347 IntervalMapImpl::Path path;
13481348
1349 explicit const_iterator(IntervalMap &map) : map(&map) {}
1349 explicit const_iterator(const IntervalMap &map) :
1350 map(const_cast(&map)) {}
13501351
13511352 bool branched() const {
13521353 assert(map && "Invalid iterator");