aboutsummaryrefslogtreecommitdiff
path: root/Stack.hpp
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-02-01 14:17:04 +0100
committerCharles <sircharlesaze@gmail.com>2020-04-15 12:59:58 +0200
commitbe2676e56ae0c72321c60c4848ce720ccf095b26 (patch)
treede96e98403ea8740cea76d9081c932cbbf8edb44 /Stack.hpp
parent7af930f2242f933f79dfbb4ddc84bfd532069556 (diff)
downloadft_containers-be2676e56ae0c72321c60c4848ce720ccf095b26.tar.gz
ft_containers-be2676e56ae0c72321c60c4848ce720ccf095b26.tar.bz2
ft_containers-be2676e56ae0c72321c60c4848ce720ccf095b26.zip
Remaking List, Removed include/, test/ and Makefile
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
+