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::meta::flatten_proxy< Tuple > Struct Template Referencefinal

Proxy wrapper that lazily exposes flattened tuple access. More...

#include <jh/metax/flatten_proxy.h>

Public Member Functions

template<std::size_t I>
constexpr auto get () const noexcept
template<typename... Ts>
constexpr operator std::tuple< Ts... > () const
constexpr operator auto () const

Public Attributes

Tuple tuple

Detailed Description

template<typename Tuple>
struct jh::meta::flatten_proxy< Tuple >

Proxy wrapper that lazily exposes flattened tuple access.

This proxy encapsulates any tuple-like object and exposes a flattened get interface compatible with structured bindings and std::tuple introspection.

Implicit Conversion

The proxy can be implicitly converted to a fully materialized std::tuple. During conversion, element category is preserved:

  • std::reference_wrapper<T> is transparently propagated
  • Structured bindings see the flattened members directly
  • Target std::tuple can hold value, reference, or wrapper types

int i0 = 1;
jh::meta::flatten_proxy p{ std::tuple{std::ref(i0), std::tuple{2, 3}} };
auto [f0, f1, f2] = p; // reference_wrapper<int>, int, int
std::tuple<std::reference_wrapper<int>, int, int> t_rw = p;
std::tuple<int&, int, int> t_ref = p;
std::tuple<int, int, int> t_val = p;
Proxy wrapper that lazily exposes flattened tuple access.
Definition flatten_proxy.h:153

Ownership and Evaluation

All operations are constexpr and non-owning — the underlying tuple-like object is never copied or moved unless materialization is explicitly requested (e.g. via implicit conversion to std::tuple).


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