Add Generate
This commit is contained in:
parent
25cd6e9eed
commit
2724f01730
1 changed files with 8 additions and 0 deletions
|
@ -573,4 +573,12 @@ inline constexpr auto operator<<(Tuple&& tuple, T&& t) {
|
|||
});
|
||||
};
|
||||
|
||||
template <std::size_t N, TupleLike Tuple = Tuple<>, typename T>
|
||||
inline constexpr auto Generate(T&& value) {
|
||||
return [&]<std::size_t... Is>(std::index_sequence<Is...>){
|
||||
return MakeTuple<Tuple>((std::ignore = Is, value)...);
|
||||
}(std::make_index_sequence<N>());
|
||||
};
|
||||
|
||||
|
||||
} // namespace utempl
|
||||
|
|
Loading…
Reference in a new issue