[PATCH] D28726: Adding const overloads of operator* and operator-> for DenseSet iterators
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Jan 14 09:45:09 PST 2017
fhahn updated this revision to Diff 84435.
https://reviews.llvm.org/D28726
Files:
include/llvm/ADT/DenseSet.h
Index: include/llvm/ADT/DenseSet.h
===================================================================
--- include/llvm/ADT/DenseSet.h
+++ include/llvm/ADT/DenseSet.h
@@ -104,6 +104,7 @@
Iterator(const typename MapTy::iterator &i) : I(i) {}
ValueT &operator*() { return I->getFirst(); }
+ const ValueT &operator*() const { return I->getFirst(); }
ValueT *operator->() { return &I->getFirst(); }
Iterator& operator++() { ++I; return *this; }
@@ -125,7 +126,7 @@
ConstIterator(const typename MapTy::const_iterator &i) : I(i) {}
- const ValueT &operator*() { return I->getFirst(); }
+ const ValueT &operator*() const { return I->getFirst(); }
const ValueT *operator->() { return &I->getFirst(); }
ConstIterator& operator++() { ++I; return *this; }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28726.84435.patch
Type: text/x-patch
Size: 799 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170114/98f00e8f/attachment.bin>
More information about the llvm-commits
mailing list