From f89b202792c118a0baa5fb7f4978dbc2077b64d4 Mon Sep 17 00:00:00 2001 From: Charles Date: Tue, 19 Nov 2019 01:51:38 +0100 Subject: basic stack and list --- stack.hpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 stack.hpp (limited to 'stack.hpp') diff --git a/stack.hpp b/stack.hpp new file mode 100644 index 0000000..64bfc66 --- /dev/null +++ b/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