aboutsummaryrefslogtreecommitdiff
path: root/Stack.htpp
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-01-31 12:46:19 +0100
committerCharles <sircharlesaze@gmail.com>2020-01-31 12:46:19 +0100
commit46b9e6f61275c4ed4cd2e8f319cad4f6bc73100f (patch)
treec33522b5337b0214154232870eaa830b3f0e4108 /Stack.htpp
parentf89b202792c118a0baa5fb7f4978dbc2077b64d4 (diff)
downloadft_containers-46b9e6f61275c4ed4cd2e8f319cad4f6bc73100f.tar.gz
ft_containers-46b9e6f61275c4ed4cd2e8f319cad4f6bc73100f.tar.bz2
ft_containers-46b9e6f61275c4ed4cd2e8f319cad4f6bc73100f.zip
List split cpp hpp (may be ridiculous and may have forgot how templates work)
Diffstat (limited to 'Stack.htpp')
-rw-r--r--Stack.htpp29
1 files changed, 29 insertions, 0 deletions
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 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
+