[STLExtras] Make const the * operator for mapped_iterator.

Summary:
The current non-const * operator shadows the const operator in
iterator_adaptor_base.

Reviewers: mehdi_amini, rriddle!, dblaikie, timshen

Subscribers: dexonsmith, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, grosul1, frgossen, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78073
This commit is contained in:
Alina Sbirlea 2020-04-13 18:51:20 -07:00
parent 3c87fba27f
commit d5fcb7966e
2 changed files with 2 additions and 2 deletions

View File

@ -214,7 +214,7 @@ public:
ItTy getCurrent() { return this->I; }
FuncReturnTy operator*() { return F(*this->I); }
FuncReturnTy operator*() const { return F(*this->I); }
private:
FuncTy F;

View File

@ -228,7 +228,7 @@ private:
explicit attr_value_iterator(ArrayAttr::iterator it)
: llvm::mapped_iterator<ArrayAttr::iterator, AttrTy (*)(Attribute)>(
it, [](Attribute attr) { return attr.cast<AttrTy>(); }) {}
AttrTy operator*() { return (*this->I).template cast<AttrTy>(); }
AttrTy operator*() const { return (*this->I).template cast<AttrTy>(); }
};
public: