aboutsummaryrefslogtreecommitdiff
path: root/Stack.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'Stack.hpp')
-rw-r--r--Stack.hpp29
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
+