[PATCH] D146232: [NFC] Add iterator traits to BitVector set_bits_iterator

Orlando Cazalet-Hyams via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 16 09:14:19 PDT 2023


Orlando created this revision.
Orlando added a reviewer: scott.linder.
Herald added a project: All.
Orlando requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

https://reviews.llvm.org/D146232

Files:
  llvm/include/llvm/ADT/BitVector.h


Index: llvm/include/llvm/ADT/BitVector.h
===================================================================
--- llvm/include/llvm/ADT/BitVector.h
+++ llvm/include/llvm/ADT/BitVector.h
@@ -24,6 +24,7 @@
 #include <cstdint>
 #include <cstdlib>
 #include <cstring>
+#include <iterator>
 #include <utility>
 
 namespace llvm {
@@ -40,6 +41,12 @@
   }
 
 public:
+  using iterator_category = std::forward_iterator_tag;
+  using difference_type   = void;
+  using value_type        = int;
+  using pointer           = value_type*;
+  using reference         = value_type&;
+
   const_set_bits_iterator_impl(const BitVectorT &Parent, int Current)
       : Parent(Parent), Current(Current) {}
   explicit const_set_bits_iterator_impl(const BitVectorT &Parent)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146232.505833.patch
Type: text/x-patch
Size: 753 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230316/388286d8/attachment.bin>


More information about the llvm-commits mailing list