From 21bc1aa6806f8dfe5b078ddb1a738481e9bc2851 Mon Sep 17 00:00:00 2001 From: Ben Deane Date: Thu, 30 Jul 2026 18:05:50 -0600 Subject: [PATCH 1/2] :sparkles: Make `filter` work for `std::tuple` Problem: - `filter` works on `stdx::tuple` only. It doesn't work on `std::tuple`. Solution: - Make it work for `std::tuple` as well. --- include/stdx/concepts.hpp | 1 - include/stdx/tuple_algorithms.hpp | 13 +++++++------ test/tuple_algorithms.cpp | 9 +++++++++ 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/include/stdx/concepts.hpp b/include/stdx/concepts.hpp index 1e1eb23..f8c74e5 100644 --- a/include/stdx/concepts.hpp +++ b/include/stdx/concepts.hpp @@ -156,7 +156,6 @@ template concept is_vacuous_tuple = tuple_size_v> == 0; constexpr inline auto concept_try_get = [](auto &x) -> decltype(auto) { - using std::get; return get<0>(x); }; diff --git a/include/stdx/tuple_algorithms.hpp b/include/stdx/tuple_algorithms.hpp index 74d8fa0..644bcbd 100644 --- a/include/stdx/tuple_algorithms.hpp +++ b/include/stdx/tuple_algorithms.hpp @@ -121,19 +121,19 @@ template }(std::make_index_sequence>{}); } -template +template [[nodiscard]] constexpr auto tuple_push_front(T &&t, Tup &&tup) -> decltype(auto) { return tuple_cons(std::forward(t), std::forward(tup)); } -template +template [[nodiscard]] constexpr auto tuple_push_back(Tup &&tup, T &&t) -> decltype(auto) { return tuple_snoc(std::forward(tup), std::forward(t)); } -template