From faad3b704f3433b207adfba438a16ee5257f8a5c Mon Sep 17 00:00:00 2001 From: Ben Deane Date: Tue, 20 Oct 2026 22:32:02 -0600 Subject: [PATCH] :bug: Fix filtering indexed tuples Problem: - Filtering an `indexed_tuple` doesn't work. Solution: - Fix it: keep the indices while filtering the elements. --- include/stdx/tuple_algorithms.hpp | 16 ++++++++++++++-- test/tuple_algorithms.cpp | 9 +++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/include/stdx/tuple_algorithms.hpp b/include/stdx/tuple_algorithms.hpp index be86d1f..011b36c 100644 --- a/include/stdx/tuple_algorithms.hpp +++ b/include/stdx/tuple_algorithms.hpp @@ -133,6 +133,18 @@ template return tuple_snoc(std::forward(tup), std::forward(t)); } +namespace detail { +template struct tuple_variation { + template + using fn = boost::mp11::mp_assign>; +}; + +template +struct tuple_variation> { + template using fn = indexed_tuple; +}; +} // namespace detail + template