summaryrefslogtreecommitdiff
path: root/algo1w4d1/Stack.cpp
blob: a83dd50c2ec5fdb4adbdb9e12a4f380cc6852dba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "Stack.h"

Stack::Stack() {}
Stack::~Stack() {}

void Stack::push(const std::string& s) {
	_stack.push_back(std::string(s));
}

const std::string& Stack::pop() {
	const std::string& s = _stack.back();
	_stack.pop_back();
	return s;
}

const std::string& Stack::peek() {
	return _stack.back();
}

unsigned Stack::size() {
	return _stack.size();
}