From 46b9e6f61275c4ed4cd2e8f319cad4f6bc73100f Mon Sep 17 00:00:00 2001 From: Charles Date: Fri, 31 Jan 2020 12:46:19 +0100 Subject: List split cpp hpp (may be ridiculous and may have forgot how templates work) --- Stack.htpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Stack.htpp (limited to 'Stack.htpp') diff --git a/Stack.htpp b/Stack.htpp new file mode 100644 index 0000000..64bfc66 --- /dev/null +++ b/Stack.htpp @@ -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