[llvm-commits] [llvm] r109562 - /llvm/trunk/include/llvm/ADT/DenseSet.h
Owen Anderson
resistor at mac.com
Tue Jul 27 16:55:47 PDT 2010
Author: resistor
Date: Tue Jul 27 18:55:47 2010
New Revision: 109562
URL: http://llvm.org/viewvc/llvm-project?rev=109562&view=rev
Log:
Fill out the interface of DenseSet a bit.
Modified:
llvm/trunk/include/llvm/ADT/DenseSet.h
Modified: llvm/trunk/include/llvm/ADT/DenseSet.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/DenseSet.h?rev=109562&r1=109561&r2=109562&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/DenseSet.h (original)
+++ llvm/trunk/include/llvm/ADT/DenseSet.h Tue Jul 27 18:55:47 2010
@@ -58,6 +58,7 @@
class Iterator {
typename MapTy::iterator I;
+ friend class DenseSet;
public:
typedef typename MapTy::iterator::difference_type difference_type;
typedef ValueT value_type;
@@ -77,6 +78,7 @@
class ConstIterator {
typename MapTy::const_iterator I;
+ friend class DenseSet;
public:
typedef typename MapTy::const_iterator::difference_type difference_type;
typedef ValueT value_type;
@@ -103,6 +105,10 @@
const_iterator begin() const { return ConstIterator(TheMap.begin()); }
const_iterator end() const { return ConstIterator(TheMap.end()); }
+ iterator find(const ValueT &V) { return Iterator(TheMap.find(V)); }
+ bool erase(Iterator I) { return TheMap.erase(I.I); }
+ bool erase(ConstIterator CI) { return TheMap.erase(CI.I); }
+
std::pair<iterator, bool> insert(const ValueT &V) {
return TheMap.insert(std::make_pair(V, 0));
}
More information about the llvm-commits
mailing list