[libcxx-commits] [libcxx] [libc++] Remove unnecessary division and modulo operations in bitset (PR #121312)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Mar 25 14:21:53 PDT 2025


================
@@ -453,7 +454,10 @@ private:
   _LIBCPP_HIDE_FROM_ABI
   _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit __bit_iterator(__storage_pointer __s, unsigned __ctz) _NOEXCEPT
       : __seg_(__s),
-        __ctz_(__ctz) {}
+        __ctz_(__ctz) {
+    _LIBCPP_ASSERT_VALID_INPUT_RANGE(
----------------
ldionne wrote:

I think this should be an internal assertion too. This is a private constructor, only called from within libc++ itself.

https://github.com/llvm/llvm-project/pull/121312


More information about the libcxx-commits mailing list