[LLVMdev] llvm::DenseSet with reverse iterator (original) (raw)
Michael Ilseman michael at lunarg.com
Thu Jul 12 09:23:20 PDT 2012
- Previous message: [LLVMdev] llvm::DenseSet with reverse iterator
- Next message: [LLVMdev] llvm::DenseSet with reverse iterator
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Something that might interest you is the SetVector, which as its name implies is both a set and a vector paired together. You get the advantage of doing set-like operations (search) on the set and vector-like operations (iteration, random access) on the vector, but at the cost of paying the price for both data structures when modifying the structure (and double the memory). This seems like it might be more heavy-weight than you needed, but it might serve your purposes. The iteration order is the insertion order; if you want some other ordering and stronger iterators, you might have to consider std::set.
[1] http://llvm.org/doxygen/SetVector_8h_source.html [2] http://llvm.org/docs/ProgrammersManual.html#dss_setvector
On Thu, Jul 12, 2012 at 10:04 AM, Owen Anderson <resistor at mac.com> wrote:
Reverse iteration doesn't really make sense for DenseSet, since its iteration order isn't meaningful to begin with...
--Owen On Jul 12, 2012, at 8:20 AM, Vassil Vassilev wrote:
Hi, I need a data structure which has fast search and I can walk it forward and backward. Is there something like that in LLVM ADT which am not aware of? And if not can I implement it in llvm::DenseSet? Vassil
LLVM Developers mailing list LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
LLVM Developers mailing list LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
- Previous message: [LLVMdev] llvm::DenseSet with reverse iterator
- Next message: [LLVMdev] llvm::DenseSet with reverse iterator
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]