[libcxx-commits] [libcxx] [libc++][ranges] add static_assert for ranges::to (PR #135802)
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Apr 19 09:33:30 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");
----------------
philnik777 wrote:
I think it would be better to say "must be a class or union". Most people don't know that a class type is a class or union.
https://github.com/llvm/llvm-project/pull/135802
More information about the libcxx-commits
mailing list