I am creating Vector class. I want to do it n-dimensional and I have to do it with STL array, not with STL vector
here is my code:
Fine I want to do values x y z and w which will be synonyms for val[0,1,2,3] but i want them to be created only only if Dimension is bigger than 1 2 3 4. I want to override []
Something like T & operator []{return ...}
I haven't found anything.
Is this possible and how?
here is my code:
template<typename T,int Dimension> class Vector{ public: Vector(T dim[Dimension]) { int i; for(i=0;i<Dimension;i++) val[i]=dim[Dimension]; }; private: array<T,Dimension> val; };
Fine I want to do values x y z and w which will be synonyms for val[0,1,2,3] but i want them to be created only only if Dimension is bigger than 1 2 3 4. I want to override []
Something like T & operator []{return ...}
I haven't found anything.
Is this possible and how?