diff --git a/include/utempl/utils.hpp b/include/utempl/utils.hpp index 004d903..fbc4e55 100644 --- a/include/utempl/utils.hpp +++ b/include/utempl/utils.hpp @@ -267,6 +267,14 @@ inline constexpr auto Filter(Tuple&& tuple, auto&& f) { ); }; +template +inline constexpr auto ForEach(Tuple&& tuple, auto&& f) { + [&](std::index_sequence){ + (f(Get(std::forward(tuple))), ...); + }(std::make_index_sequence>()); +}; + + template struct Curryer { F f;