My goal is to make this template work:
template <size_t... Ns>
struct mult
{
using cross = ?; // variadic size_t
static_assert(sizeof...(cross) + 1 == sizeof...(Ns), "");
};
So I can use it like this:
mult<2,3,5>::cross // 6,15 // because 2*3=6, 3*5=15
mult<3,5,7,11>::cross // 15,35,77 // because 3*5=15, 5*7=35, 7*11=77
Because I need to make this:
// tuple of arrays
std::tuple<std::array<size_t, mult<Ns...>::cross>...> cross_arrays;
If you want compile time computation, write
constexprfunctionsThey're easier to read, write and looks more or less the same as normal functions.
Use as