|
JH-Toolkit v1.4.1
An engineering-oriented C++20 toolkit with duck-typed concepts, static design, async coroutines, and semantic containers — header-only, RTTI-free, and concurrency-friendly.
|
View adaptor for flattening tuple-like elements in a range. More...
Go to the source code of this file.
Namespaces | |
| namespace | jh::ranges |
| Semantic pipeline namespace for JH range operations. | |
| namespace | jh::ranges::views |
| Range view adaptor implementations with explicit semantic control. | |
Variables | |
| constexpr detail::flatten_fn | jh::ranges::views::flatten {} |
User-facing flatten adaptor. | |
View adaptor for flattening tuple-like elements in a range.
The jh::ranges::views::flatten adaptor produces a lazy view that inspects each element of a range and, if it models jh::concepts::tuple_like, wraps it in a jh::meta::flatten_proxy. Non-tuple-like elements are forwarded unchanged.
jh::meta::flatten_proxy objects. flatten delegates to jh::ranges::views::transform. jh::ranges::views::transform internally decides whether to construct a non-consuming or consuming transformation view depending on the behavior of the projection function. flatten is a pure observation, its output preserves the consumption property of the underlying range: if the input is non-consuming, the output remains non-consuming; if the input is single-pass, the result is also single-pass. 1.3.x
2025