[libcxx-commits] [libcxx] [libc++][ranges] add static_assert for ranges::to (PR #135802)
A. Jiang via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Apr 20 23:59:06 PDT 2025
================
@@ -0,0 +1,72 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
+
+// Test that the "mandates" requirements on the given class are checked using `static_assert`.
+#include <ranges>
+void ff() {}
+void test() {
----------------
frederick-vs-ja wrote:
I wonder whether it would be better to rename this function to `test_unexpected_types` and move it to `to.static_assert.verify.cpp`. The old `test` function can be renamed to `test_cv` or `test_cv_qualifications`.
https://github.com/llvm/llvm-project/pull/135802
More information about the libcxx-commits
mailing list