[libc++][ranges] implement `ranges::elements_of` (#91414)
## Introduction
This patch implements `ranges::elements_of` from
[P2502R2](https://wg21.link/P2502R2). Specializations of `elements_of`
encapsulate a range and act as a tag in overload sets to disambiguate
when a range should be treated as a sequence rather than a single value.
```cpp
template <bool YieldElements>
std::generator<std::any> f(std::ranges::input_range auto &&r) {
if constexpr (YieldElements) {
co_yield std::ranges::elements_of(r);
} else {
co_yield r;
}
}
```
## Reference
- [P2502R2: `std::generator`: Synchronous Coroutine Generator for
Ranges](https://wg21.link/P2502R2)
- [[range.elementsof]](https://eel.is/c++draft/range.elementsof)
Partially addresses #105226
---------
Co-authored-by: Louis Dionne <[email protected]>
Co-authored-by: A. Jiang <[email protected]>
NOKEYCHECK=True
GitOrigin-RevId: fa79e0a4001a18fd536ddfddcedc176efcf6a69c
7 files changed