[libcxx-commits] [libcxx] [libc++] fix flat_{multi}set insert_range (PR #137462)

via libcxx-commits libcxx-commits at lists.llvm.org
Sun Apr 27 05:46:57 PDT 2025


================
@@ -60,7 +61,8 @@ struct __flat_set_utils {
       // C++23 Sequence Container should have insert_range member function
       // Note that not all Sequence Containers provide append_range.
       __set.__keys_.insert_range(__set.__keys_.end(), std::forward<_Range>(__rng));
-    } else if constexpr (ranges::common_range<_Range>) {
+    } else if constexpr (ranges::common_range<_Range> &&
+                         __has_input_iterator_category<ranges::iterator_t<_Range>>::value) {
----------------
huixie90 wrote:

added static_assert in the test case

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


More information about the libcxx-commits mailing list