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.
Loading...
Searching...
No Matches
jh::ranges::zip_reference_proxy< Es > Struct Template Reference

Aggregates element references for a single tuple in jh::ranges::zip_view. More...

#include <jh/ranges/zip_view.h>

Public Member Functions

constexpr operator zip_proxy_value_tuple_t< zip_reference_proxy > () const &
constexpr operator zip_proxy_value_tuple_t< zip_reference_proxy > () &&
template<std::size_t N>
constexpr decltype(auto) get () const &noexcept
template<std::size_t N>
constexpr decltype(auto) get () &&noexcept

Public Attributes

std::tuple< Es... > elems

Detailed Description

template<typename... Es>
struct jh::ranges::zip_reference_proxy< Es >

Aggregates element references for a single tuple in jh::ranges::zip_view.

zip_reference_proxy acts as the dereference result of zip_iterator, holding a tuple of element references (or values) from the underlying ranges.

This proxy provides structured binding support by exposing a member get<I>() and a corresponding free function get<I>(const zip_reference_proxy&), making it behave as a tuple-like object compatible with std::get and std::tuple_size.

When dereferencing zip_iterator, each element of the aggregated tuple may be either:

  • a direct reference, if the source element is an lvalue;
  • a std::reference_wrapper, if wrapped through detail::wrap_element();
  • a value, if the range yields temporaries (e.g. std::views::iota).

The proxy abstracts over these distinctions so that element access through get<I>() always yields a reference to the underlying element.

Template Parameters
EsThe element types of the aggregated tuple. Each may be a reference, std::reference_wrapper, or value type.
See also
jh::ranges::zip_iterator
jh::ranges::zip_view

The documentation for this struct was generated from the following file: