[llvm] ee928e3 - [NFC] Add iterator traits to BitVector set_bits_iterator

via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 21 02:12:09 PDT 2023


Author: OCHyams
Date: 2023-03-21T09:11:54Z
New Revision: ee928e322861085eaf7ea18120eca8a8a4c6201e

URL: https://github.com/llvm/llvm-project/commit/ee928e322861085eaf7ea18120eca8a8a4c6201e
DIFF: https://github.com/llvm/llvm-project/commit/ee928e322861085eaf7ea18120eca8a8a4c6201e.diff

LOG: [NFC] Add iterator traits to BitVector set_bits_iterator

Reviewed By: scott.linder

Differential Revision: https://reviews.llvm.org/D146232

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ADT/BitVector.h b/llvm/include/llvm/ADT/BitVector.h
index 1a78859ba9889..a8847a3267537 100644
--- a/llvm/include/llvm/ADT/BitVector.h
+++ b/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 @@ template <typename BitVectorT> class const_set_bits_iterator_impl {
   }
 
 public:
+  using iterator_category = std::forward_iterator_tag;
+  using 
diff erence_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)


        


More information about the llvm-commits mailing list