diff --git a/include/utempl/utils.hpp b/include/utempl/utils.hpp index a12a24d..d4e9c2a 100644 --- a/include/utempl/utils.hpp +++ b/include/utempl/utils.hpp @@ -175,6 +175,14 @@ inline constexpr auto Map(Tuple&& tuple, F&& f, TypeList result = {}) { }; +template +inline constexpr auto Unpack(Tuple&& tuple, F&& f) -> decltype(auto) { + return [&](std::index_sequence) -> decltype(auto) { + return f(Get(std::forward(tuple))...); + }(std::make_index_sequence>()); +}; + + template inline constexpr auto Reverse(Tuple&& tuple) { return [&](std::index_sequence) {