From b967fe9e37934a849b73292f857bb7a1c966e266 Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Wed, 19 Jun 2024 19:16:13 +0200 Subject: [PATCH] Remove unneeded pack_to_tuple_t helper Drop the pack_to_tuple_t helper which is not particularly needed and adds an implicit dependency of "Framework/Pack.h" on . --- Framework/Core/include/Framework/GroupedCombinations.h | 3 +++ Framework/Foundation/include/Framework/Pack.h | 9 --------- Framework/Foundation/test/test_FunctionalHelpers.cxx | 1 - 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/Framework/Core/include/Framework/GroupedCombinations.h b/Framework/Core/include/Framework/GroupedCombinations.h index f88a534cc9727..2b0c833e06c25 100644 --- a/Framework/Core/include/Framework/GroupedCombinations.h +++ b/Framework/Core/include/Framework/GroupedCombinations.h @@ -49,6 +49,9 @@ expressions::BindingNode getMatchingIndexNode() template struct GroupedCombinationsGenerator { + template + using pack_to_tuple_t = decltype(std::apply([](auto... t) { return std::tuple(t...); }, P{})); + using GroupedIteratorType = pack_to_tuple_t, pack>>; struct GroupedIterator : public GroupingPolicy { diff --git a/Framework/Foundation/include/Framework/Pack.h b/Framework/Foundation/include/Framework/Pack.h index f03476f4fdc0e..a8b6ab5a94e92 100644 --- a/Framework/Foundation/include/Framework/Pack.h +++ b/Framework/Foundation/include/Framework/Pack.h @@ -317,15 +317,6 @@ constexpr auto unique_pack(pack, PT p2) template using unique_pack_t = decltype(unique_pack(P{}, pack<>{})); -template -inline constexpr std::tuple pack_to_tuple(pack) -{ - return std::tuple{}; -} - -template -using pack_to_tuple_t = decltype(pack_to_tuple(P{})); - template inline auto sequence_to_pack(std::integer_sequence) { diff --git a/Framework/Foundation/test/test_FunctionalHelpers.cxx b/Framework/Foundation/test/test_FunctionalHelpers.cxx index 188d91433cdfd..a0e4f9725c597 100644 --- a/Framework/Foundation/test/test_FunctionalHelpers.cxx +++ b/Framework/Foundation/test/test_FunctionalHelpers.cxx @@ -58,7 +58,6 @@ TEST_CASE("TestOverride") static_assert(std::is_same_v>, pack>, "pack should not have duplicated types"); static_assert(std::is_same_v, pack>, pack>, "interleaved packs of the same size"); - static_assert(std::is_same_v>, std::tuple>, "pack should become a tuple"); static_assert(std::is_same_v, pack>, "pack should have float repeated 5 times"); struct ForwardDeclared;