[libcxx-commits] [PATCH] D122092: [libc++] `bitset::operator[] const` should return bool

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Apr 6 11:03:23 PDT 2022


ldionne accepted this revision.
ldionne added a comment.
This revision is now accepted and ready to land.

LGTM once CI is passing. Please ping me again if it ends up being more complicated than just removing the now redundant `insert()` method. Thanks for the cleanup!



================
Comment at: libcxx/include/vector:2086
 private:
     _LIBCPP_INLINE_VISIBILITY
     size_type& __cap() _NOEXCEPT
----------------
To fix the CI issue, I think you'll need to remove the additional `insert(...)` method we have that takes a `const_reference`. It's not in the spec, and it was probably just provided to make it work with our non-conforming `const_reference` type.

You should also survey for other places where we take a `const_reference` and make sure that those methods are all part of the spec -- it's possible that we have other cases like this, and we might not catch them (I don't know how good our coverage is for `std::vector<bool>`).


================
Comment at: libcxx/test/std/utilities/template.bitset/bitset.members/index.pass.cpp:61-64
+    set[0] = false;
+    auto b = set[0];
+    set[0] = true;
+    assert(b);
----------------



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122092



More information about the libcxx-commits mailing list