Original Post
I''m writing a Tensor class with an element access operator ().
() takes as many arguments as the dimension of the Tensor.
So for a 2-tensor we''d have
and so on.
I would like to template (or otherwise) the class so the number of arguments to () can be determined and the appropriate function defined automatically.
Is this possible and can anyone provide some ideas on how to do it?
thanking you ...
inline float& operator(int e1, int e2);
whilst for a 3-tensor it would be
inline float& operator(int e1, int e2, int e3);