[libcxx-commits] [libcxx] [libc++] Fix {deque, vector}::append_range assuming too much about the types (PR #162438)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Oct 8 07:48:13 PDT 2025


================
@@ -643,6 +643,42 @@ constexpr void test_sequence_assign_range_move_only() {
   c.assign_range(in);
 }
 
+struct InPlaceOnly {
+  InPlaceOnly(const InPlaceOnly&) = delete;
+  InPlaceOnly(InPlaceOnly&&) = delete;
+  InPlaceOnly& operator=(const InPlaceOnly&) = delete;
+  InPlaceOnly& operator=(InPlaceOnly&&) = delete;
+  constexpr InPlaceOnly() {}
+};
+
+struct MoveConstructOnly {
----------------
ldionne wrote:

How about `EmplaceConstructible` since this is roughly trying to model `Cpp17EmplaceConstructible`? For `std::vector`, we can introduce another type named `VectorEmplaceConstructible` (or `EmplaceConstructibleOrMoveInsertable` -- yeah all these names are awkward).

Otherwise, should we be using `TaggingAllocator` from `test_allocators.h`?

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


More information about the libcxx-commits mailing list