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
flatten_proxy.h File Reference

Tuple flattening utilities and proxy wrapper for nested tuple-like types. More...

#include "jh/conceptual/tuple_like.h"
#include <tuple>
#include <utility>
#include <type_traits>

Go to the source code of this file.

Classes

struct  jh::meta::flatten_proxy< Tuple >
 Proxy wrapper that lazily exposes flattened tuple access. More...
struct  std::tuple_size< jh::meta::flatten_proxy< Tuple > >
struct  std::tuple_element< I, jh::meta::flatten_proxy< Tuple > >

Namespaces

namespace  jh::meta
 Aggregated entry point for compile-time metaprogramming utilities.

Functions

template<typename Tuple>
constexpr auto jh::meta::tuple_materialize (const Tuple &t)
 Flattens a tuple-like object into a fully materialized std::tuple.
template<std::size_t I, typename Tuple>
constexpr decltype(auto) jh::meta::get (const flatten_proxy< Tuple > &p) noexcept

Detailed Description

Tuple flattening utilities and proxy wrapper for nested tuple-like types.

Author
JeongHan-Bae <mastropseudo@gmail.com>

The jh::meta::flatten_proxy mechanism provides a compile-time meta-layer for expanding and materializing arbitrarily nested tuple_like structures into a single flattened std::tuple.

Design Goals

  • Provide a zero-overhead flattening proxy for tuple-like objects.
  • Support composition of nested proxy or view types that model tuple_like.
  • Expose a clean tuple_materialize() API for generic metaprogramming.

Key Components

Design Notes

  • Compatible with proxy-based tuple types such as zip_reference_proxy.
  • All transformations are constexpr and reference-safe.
  • Integrates with std::tuple_size / std::tuple_element for structured binding compatibility.

Version
1.3.x
Date
2025