hello! I was recently introduced to variadic templates in C++ by a friend and i feel like i have an use case that would really benefit from them but i can't really wrap my head around them and the syntax of the ellipsis (...) operator
I have reduced my code to this short snippet, it is for a linear algebra library i am developing for personal use:
template<int first>
class Tensor{
float data[first];
};
template<int first, int... sizes>
class Tensor{
Tensor<sizes...> data[first];
};
as i understand it, this should define a template where the amount of template arguments that are passed should determine the "depth" of the data structure; each value determines the amount of elements stored on each "node" of the data structure.
for example:
Tensor<3,2,4> myTensor;
should essentially create a three dimensional array of float of size 3x2x4
can i get some help pointing out where i am wrong and maybe a piece of code that reflects the right way to do what i am pursuing?