I want to make a variadic template with exactly N arguments, where N is also a template parameter. For example,
template <int N, typename T[N]>
void function(T t[N]) {
// do stuff with t[0] through t[N-1]
}
(I realize the above is not valid syntax)
I know that one way to achieve this is to use a static_assert on sizeof...(ArgsT) where ArgsT is a variadic template definition (i.e. template <typename ...ArgsT>).
I am just wondering if there is a better way, not necessarily involving static_assert.