[libc-commits] [PATCH] D136881: [libc] add features to bitset

Michael Jones via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Oct 27 15:04:51 PDT 2022


michaelrj added inline comments.


================
Comment at: libc/src/__support/CPP/bitset.h:35
+  // true. It assumes that Start < End.
+  constexpr void set_range(size_t Start, size_t End) {
+    size_t start_index = Start / BITS_PER_UNIT;
----------------
sivachandra wrote:
> This method is not in `std::bitset` so we should not include it here. You can define a helper function in the other patch with the same functionality.
defining this function outside of the bitset class is less efficient because the internal `Data` array is private. I could implement it as a loop of calls to `set` but that would be masking one bit at a time.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136881/new/

https://reviews.llvm.org/D136881



More information about the libc-commits mailing list