diff options
Diffstat (limited to 'stack.hpp')
| -rw-r--r-- | stack.hpp | 29 |
1 files changed, 29 insertions, 0 deletions
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 T, class Container = deque<T> > + 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 + |
