From 7af930f2242f933f79dfbb4ddc84bfd532069556 Mon Sep 17 00:00:00 2001 From: Charles Date: Sat, 1 Feb 2020 10:37:15 +0100 Subject: Basic list methods --- include/Stack.hpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 include/Stack.hpp (limited to 'include/Stack.hpp') diff --git a/include/Stack.hpp b/include/Stack.hpp new file mode 100644 index 0000000..64bfc66 --- /dev/null +++ b/include/Stack.hpp @@ -0,0 +1,29 @@ +#ifndef STACK_HPP +# define STACK_HPP + +# include "vector.hpp" + +namespace ft +{ + template > + class stack : public vector + { + public: + explicit stack (const container_type& ctnr = container_type()); + value_type& top() + { + return back(); + } + void push (const value_type& val) + { + push_back(val); + } + void pop() + { + pop_back(); + } + }; +} + +#endif + -- cgit