From 888ec0f342389ba9c465a76b9f138a570c32d3b9 Mon Sep 17 00:00:00 2001 From: sha512sum Date: Tue, 26 Mar 2024 09:15:40 +0000 Subject: [PATCH] Use unpack istead directly get with std::index_sequence --- include/cserver/engine/components.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/cserver/engine/components.hpp b/include/cserver/engine/components.hpp index 8236930..5c7b43c 100644 --- a/include/cserver/engine/components.hpp +++ b/include/cserver/engine/components.hpp @@ -278,9 +278,11 @@ consteval auto TopologicalSort(const DependencyGraph(Tuple&& tuple){ static constexpr auto Size = utempl::kTupleSize; - return [&](std::index_sequence) -> std::array { - return {Find(names, Get(std::forward(tuple)))...}; - }(std::make_index_sequence()); + return utempl::Unpack(std::forward(tuple), + [&](Args&&... args) -> std::array { + return {Find(names, std::forward(args))...}; + } + ); }); constexpr auto Size = utempl::kTupleSize; const std::array adj = utempl::Map(storage,