|
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.
|
Internal implementation for jh::ranges::zip_view.
More...
#include <tuple>#include <ranges>#include <utility>#include <type_traits>#include <functional>Go to the source code of this file.
Namespaces | |
| namespace | jh::ranges |
| Semantic pipeline namespace for JH range operations. | |
Macros | |
| #define | JH_HAS_STD_ZIP_VIEW 0 |
Feature detection for std::ranges::zip_view availability. | |
Typedefs | |
| template<typename T> | |
| using | jh::ranges::zip_proxy_value_tuple_t = typename zip_proxy_value_tuple<T>::type |
Functions | |
| template<typename F, typename Tuple> | |
| constexpr auto | jh::ranges::tuple_transform (F &&f, Tuple &&t) |
Applies a callable to each element of a std::tuple. | |
| template<std::size_t I, typename... Elems> | |
| constexpr decltype(auto) | jh::ranges::get (const zip_reference_proxy< Elems... > &p) noexcept |
Retrieves the I-th element from a zip_reference_proxy. | |
| template<typename... Iters, typename... Sentinels> | |
| constexpr bool | jh::ranges::operator== (const zip_sentinel< Sentinels... > &s, const zip_iterator< Iters... > &it) |
| template<typename... Iters, typename... Sentinels> | |
| constexpr bool | jh::ranges::operator!= (const zip_sentinel< Sentinels... > &s, const zip_iterator< Iters... > &it) |
| template<std::ranges::viewable_range... Rs> | |
| jh::ranges::zip_view (Rs &&...) -> zip_view< std::views::all_t< Rs >... > | |
Deduction guide for jh::ranges::zip_view. | |
Variables | |
| template<typename T> | |
| constexpr bool | jh::ranges::is_zip_proxy_v = is_zip_proxy<T>::value |
| template<typename... Views> | |
| constexpr bool | std::ranges::enable_borrowed_range< jh::ranges::zip_view< Views... > > |
Legal specialization of std::ranges::enable_borrowed_range. | |
Internal implementation for jh::ranges::zip_view.
Defines the implementation of jh::ranges::zip_view — a lightweight, C++20-compatible view that aggregates multiple ranges into synchronized tuples of references.
This header is part of the ranges module and serves as an internal dependency of jh::ranges::views::zip and jh::ranges::views::enumerate. It is not intended for direct inclusion by user code.
Semantic equivalence:
jh::ranges::zip_view provides the same observable behavior as std::ranges::zip_view (C++23 and later). When the standard implementation is available, jh::ranges::zip_view transparently aliases it through feature detection. Otherwise, this header defines a portable fallback implementation with identical semantics and API surface.
This design follows the same principle as boost::string_view — offering a pre-standard, fully compatible type that later becomes a transparent bridge to its standard counterpart once available.
The fallback implementation includes:
zip_iterator — synchronized iterator tuple zip_sentinel — range termination marker zip_reference_proxy — reference aggregator for structured bindings Together, these emulate the complete semantics of std::ranges::zip_view for C++20 environments.