[libcxx-commits] [libcxx] [libc++][ranges] add static_assert for ranges::to (PR #135802)

via libcxx-commits libcxx-commits at lists.llvm.org
Sun Apr 20 10:37:09 PDT 2025


================
@@ -81,7 +83,7 @@ template <class _Container, input_range _Range, class... _Args>
   static_assert(!is_const_v<_Container>, "The target container cannot be const-qualified, please remove the const");
   static_assert(
       !is_volatile_v<_Container>, "The target container cannot be volatile-qualified, please remove the volatile");
-
+  static_assert(is_class_v<_Container> || is_union_v<_Container>, "The target must be a class type");
----------------
Yuzhiy05 wrote:

thanks for spotting that,i have added it

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


More information about the libcxx-commits mailing list