From be2676e56ae0c72321c60c4848ce720ccf095b26 Mon Sep 17 00:00:00 2001 From: Charles Date: Sat, 1 Feb 2020 14:17:04 +0100 Subject: Remaking List, Removed include/, test/ and Makefile --- 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