Practice ยท 1 of 1
Class template: Stack<T>
Implement template <typename T> class Stack backed by std::vector<T> with: void push(T), T pop() (removes and returns the top โ moving, not copying), const T& top() const, bool empty() const, std::size_t size() const. It must instantiate for int and std::string.
Difficulty: intermediate
Press Submit to check your solution.
Back to lesson: Practice: Class template practice