front() and pop_front() allow convenient usage of a std::dequeue as the
underlying vector type.
The new constructor allows to pass in instances of the underlying set/vector.
This is useful when using a BitSet as the Set type to be able to initialized
it to a maximum element size.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Test cases?
Got use cases in mind? (specific new/incoming patches to LLVM projects that
will use this functionality)
& 'resize' seems like the wrong name for a set or map operation - perhaps
"reserve"? (I think there was a recent change for this rename in DenseMap,
right?)
Added unittests for the new methods and the missing tests for nearly all of the other methods.
See http://reviews.llvm.org/D18427
& 'resize' seems like the wrong name for a set or map operation - perhaps
"reserve"? (I think there was a recent change for this rename in DenseMap,
right?)
It is still called resize() in DenseSet, SmallPtrSet and BitVector so I'd like to keep that name for consistency. Of course someone else can rename them all to reserve() in the future.
New version which does not introduce the resize() (or reserve()) operation anymore in favor of a constructor allowing to supply (empty) instances for the vector and set.
That seems like a somewhat strange API - calling reserve down into the
vector (& possibly the set, for things like DenseSet) seems more
appropriate, no?
After the discussions here I felt that reserve()/resize() are details of the underlying set not necessarily a common agreed interface supported by all sets, what if the next set implementation has additional methods for tuning? An alternative to that strange constructor would be to expose the set object so people can call reserve()/resize() on it directly though it breaks isolation.
Yeah, not sure - wouldn't mind some other voices here to see how people
feel.
Reserve isn't part of any STL concept so far as I can tell, so, yes, to
that degree it is an implementation detail.
Abandoning for lack of progress and use case. The motivating pass simply uses a combination of BitVector+Set instead of a SetVector now.