[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


================
@@ -489,7 +490,21 @@ class vector {
 #if _LIBCPP_STD_VER >= 23
   template <_ContainerCompatibleRange<_Tp> _Range>
   _LIBCPP_HIDE_FROM_ABI constexpr void append_range(_Range&& __range) {
-    insert_range(end(), std::forward<_Range>(__range));
+    if constexpr (ranges::forward_range<_Range> || ranges::sized_range<_Range>) {
----------------
ldionne wrote:

Do we have any tests with a sized input range? If not, can we add one?

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


More information about the libcxx-commits mailing list