Skip to content

Commit

Permalink
Remove unneeded pack_to_tuple_t helper
Browse files Browse the repository at this point in the history
Drop the pack_to_tuple_t helper which is not particularly needed
and adds an implicit dependency of "Framework/Pack.h" on <tuple>.
  • Loading branch information
ktf committed Jun 19, 2024
1 parent 37c0a56 commit b967fe9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
3 changes: 3 additions & 0 deletions Framework/Core/include/Framework/GroupedCombinations.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ expressions::BindingNode getMatchingIndexNode()

template <typename T1, typename GroupingPolicy, typename BP, typename G, typename... As>
struct GroupedCombinationsGenerator {
template <typename P>
using pack_to_tuple_t = decltype(std::apply([](auto... t) { return std::tuple(t...); }, P{}));

using GroupedIteratorType = pack_to_tuple_t<interleaved_pack_t<repeated_type_pack_t<typename G::iterator, sizeof...(As)>, pack<As...>>>;

struct GroupedIterator : public GroupingPolicy {
Expand Down
9 changes: 0 additions & 9 deletions Framework/Foundation/include/Framework/Pack.h
Original file line number Diff line number Diff line change
Expand Up @@ -317,15 +317,6 @@ constexpr auto unique_pack(pack<T, Ts...>, PT p2)
template <typename P>
using unique_pack_t = decltype(unique_pack(P{}, pack<>{}));

template <typename... Ts>
inline constexpr std::tuple<Ts...> pack_to_tuple(pack<Ts...>)
{
return std::tuple<Ts...>{};
}

template <typename P>
using pack_to_tuple_t = decltype(pack_to_tuple(P{}));

template <typename T, std::size_t... Is>
inline auto sequence_to_pack(std::integer_sequence<std::size_t, Is...>)
{
Expand Down
1 change: 0 additions & 1 deletion Framework/Foundation/test/test_FunctionalHelpers.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ TEST_CASE("TestOverride")

static_assert(std::is_same_v<unique_pack_t<pack<int, float, int, float, char, char>>, pack<char, float, int>>, "pack should not have duplicated types");
static_assert(std::is_same_v<interleaved_pack_t<pack<int, float, int>, pack<char, bool, char>>, pack<int, char, float, bool, int, char>>, "interleaved packs of the same size");
static_assert(std::is_same_v<pack_to_tuple_t<pack<int, float, char>>, std::tuple<int, float, char>>, "pack should become a tuple");
static_assert(std::is_same_v<repeated_type_pack_t<float, 5>, pack<float, float, float, float, float>>, "pack should have float repeated 5 times");

struct ForwardDeclared;
Expand Down

0 comments on commit b967fe9

Please sign in to comment.