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

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Fri Mar 21 23:42:06 PDT 2025


================
@@ -81,6 +81,8 @@ 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>, "The target must be a class type");
----------------
frederick-vs-ja wrote:

The changes should be clang-formatted. Ditto below.
```suggestion
  static_assert(is_class_v<_Container>, "The target must be a class type");
```

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


More information about the libcxx-commits mailing list