[libcxx-commits] [libcxx] [libc++] Fix {deque, vector}::append_range assuming too much about the types (PR #162438)
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Oct 8 23:52:47 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 {
+ MoveConstructOnly(const MoveConstructOnly&) = delete;
+ MoveConstructOnly& operator=(const MoveConstructOnly&) = delete;
+ MoveConstructOnly& operator=(MoveConstructOnly&&) = delete;
+ constexpr MoveConstructOnly(MoveConstructOnly&&) {}
+ constexpr MoveConstructOnly(const InPlaceOnly&) {}
+};
+
+template <template <class...> class Container>
----------------
philnik777 wrote:
I've decided to make it a separate function instead. There doesn't seem to be much point in special-casing anything here, since the requirements are different in the end.
https://github.com/llvm/llvm-project/pull/162438
More information about the libcxx-commits
mailing list