From 2724f017302211adb9de83fa018e1fd3cd41744a Mon Sep 17 00:00:00 2001 From: sha512sum Date: Tue, 16 Apr 2024 21:17:35 +0000 Subject: [PATCH] Add Generate --- include/utempl/utils.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/utempl/utils.hpp b/include/utempl/utils.hpp index 04441f5..83dd9c7 100644 --- a/include/utempl/utils.hpp +++ b/include/utempl/utils.hpp @@ -573,4 +573,12 @@ inline constexpr auto operator<<(Tuple&& tuple, T&& t) { }); }; +template , typename T> +inline constexpr auto Generate(T&& value) { + return [&](std::index_sequence){ + return MakeTuple((std::ignore = Is, value)...); + }(std::make_index_sequence()); +}; + + } // namespace utempl