[libcxx-commits] [libcxx] [libc++][ranges] Ensure range access CPOs are provided in `<iterator>` (PR #151745)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Aug 13 16:26:18 PDT 2025


================
@@ -0,0 +1,60 @@
+//===----------------------------------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+// REQUIRES: std-at-least-c++20
+
+// [range.access.general]/1:
+// In addition to being available via inclusion of the <ranges> header, the customization point objects in
+// [range.access] are available when the header <iterator> is included.
+
+#include <iterator>
+#include <type_traits>
+
+#include "test_macros.h"
+
+template <class CPO, class... Args>
+constexpr bool test(CPO& o, Args&&...) {
----------------
ldionne wrote:

```suggestion
constexpr bool test(CPO& o, Args&&... args) {
```

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


More information about the libcxx-commits mailing list