Junior — Senior
Template container class with add operation
livecode
Task condition
It is necessary to design a template class representing a simplified vector that provides a public method for inserting a new element at the end of the container.
template<typename T>
class MyVector {
public:
void push_back(const T& elem);
};
The push_back method should accept a constant reference to an object of type T and ensure its addition to the data structure.