I have an exercise and I could not understand what the assignment is talking about.
This is the text of the exercise
Provide static vector implementation in modern C++.
Class must be namedstatic_vector
and templated by the stored type
and vector’s capacity. Class must provide methods:
capacity()
push_back()
size()
subscript operator [ ]
So far I came up with this code
template <class T, unsigned int C>
class static_vector{
public:
unsigned int capacity() {return vect_capacity;}
void push_back(T item) {}
unsigned int size() {}
T& operator[] (unsigned int index) {}
private:
unsigned int vect_capacity;
};
My misunderstanding is about the meaning of static and the development of the required functions.
Any help would be much appreciated.