aboutsummaryrefslogtreecommitdiff
path: root/stack.hpp
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2019-11-19 01:51:38 +0100
committerCharles <sircharlesaze@gmail.com>2019-11-19 02:40:38 +0100
commitf89b202792c118a0baa5fb7f4978dbc2077b64d4 (patch)
treee205c23ca8cb490122beda2d58a28b4361f08eb7 /stack.hpp
parentfebf0637f9869419bc5864543c89e3fd0b1ac316 (diff)
downloadft_containers-f89b202792c118a0baa5fb7f4978dbc2077b64d4.tar.gz
ft_containers-f89b202792c118a0baa5fb7f4978dbc2077b64d4.tar.bz2
ft_containers-f89b202792c118a0baa5fb7f4978dbc2077b64d4.zip
basic stack and list
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
+