// // RecursiveExpander.h // iterator // // Created by Sam Jaffe on 9/23/25. // Copyright © 2025 Sam Jaffe. All rights reserved. // #pragma once #include #include #include #include #include namespace iterator::detail { template using projection_t = std::invoke_result_t, std::integral_constant>; template >> struct RecursiveExpander { using type = std::tuple>; }; template struct RecursiveExpander, N> { using type = std::tuple>; }; template struct RecursiveExpander { using projected_value_type = projection_t; using expand_next = RecursiveExpander, Projs, MaxDepth, N + 1>; using type = tuple_cat_t>, typename expand_next::type>; }; template struct RecursiveExpander { using projected_value_type = std::tuple_element_t<1, std::remove_reference_t>>; using expand_next = RecursiveExpander, Projs, MaxDepth, N + 1>; using type = tuple_cat_t>, typename expand_next::type>; }; }