From d5786127e1b93e43dccf9a8799213ad2359827c4 Mon Sep 17 00:00:00 2001 From: Ben Deane Date: Mon, 21 Apr 2025 13:18:12 -0600 Subject: [PATCH] :bug: Remove dependency on tuple destructuring Problem: - Tuple destructuring is used by `initial_medial_final`. - Destructuring `stdx::tuple` requires including `` which includes ``. Solution: - Remove the destructuring; use `get` instead. Closes #218 --- include/stdx/algorithm.hpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/include/stdx/algorithm.hpp b/include/stdx/algorithm.hpp index d6e60a9..d16d05a 100644 --- a/include/stdx/algorithm.hpp +++ b/include/stdx/algorithm.hpp @@ -127,11 +127,14 @@ CONSTEXPR_INVOKE auto initial_medial_final(FwdIt first, FwdIt last, IOp iop, -> for_each_result { if (first != last) { iop(*first); - auto [op, it] = for_each_butlast(++first, last, mop); - if (it != last) { + auto r = for_each_butlast(++first, last, mop); +#if __cplusplus < 202002L + using std::get; +#endif + if (auto it = get<1>(r); it != last) { fop(*it); } - return {iop, op, fop}; + return {iop, get<0>(r), fop}; } return {iop, mop, fop}; }