[libcxx-commits] [libcxx] [libc++][ranges] export `std::ranges::range_adaptor_closure` (PR #89793)

Xiaoyang Liu via libcxx-commits libcxx-commits at lists.llvm.org
Tue Apr 23 09:49:52 PDT 2024


https://github.com/xiaoyang-sde created https://github.com/llvm/llvm-project/pull/89793

## Abstract

This pull request exports the `std::ranges::range_adaptor_closure` class template implemented in #89148.

```cpp
// [range.adaptor.object], range adaptor objects
template<class D>
  requires is_class_v<D> && same_as<D, remove_cv_t<D>>
class range_adaptor_closure { };
```

## Reference

- [P2387R3: Pipe support for user-defined range adaptors](https://wg21.link/P2387R3)
- [C++ Draft Standard: [range.adaptor.object]](https://eel.is/c++draft/range.adaptor.object)
- #89148

>From 713634b1fff71a873168419978bdd0d9d9fed9c8 Mon Sep 17 00:00:00 2001
From: Xiaoyang Liu <siujoeng.lau at gmail.com>
Date: Tue, 23 Apr 2024 12:47:19 -0400
Subject: [PATCH] [libc++][ranges] export 'std::ranges::range_adaptor_closure'

---
 libcxx/modules/std/ranges.inc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libcxx/modules/std/ranges.inc b/libcxx/modules/std/ranges.inc
index 82c7d99f8979a8..7d215867a4317f 100644
--- a/libcxx/modules/std/ranges.inc
+++ b/libcxx/modules/std/ranges.inc
@@ -138,8 +138,10 @@ export namespace std {
     }
 #endif // _LIBCPP_HAS_NO_LOCALIZATION
 
+#if _LIBCPP_STD_VER >= 23
     // [range.adaptor.object], range adaptor objects
-    // using std::ranges::range_adaptor_closure;
+    using std::ranges::range_adaptor_closure;
+#endif
 
     // [range.all], all view
     namespace views {



More information about the libcxx-commits mailing list