diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-02-01 10:37:15 +0100 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-02-01 10:37:15 +0100 |
| commit | 7af930f2242f933f79dfbb4ddc84bfd532069556 (patch) | |
| tree | bc24aae2b8f8f446bdfbe83f56336a7c6d7a98db /include/Stack.hpp | |
| parent | 6e191a07bbc57d73152ba886b6f76f694a97e525 (diff) | |
| download | ft_containers-7af930f2242f933f79dfbb4ddc84bfd532069556.tar.gz ft_containers-7af930f2242f933f79dfbb4ddc84bfd532069556.tar.bz2 ft_containers-7af930f2242f933f79dfbb4ddc84bfd532069556.zip | |
Basic list methods
Diffstat (limited to 'include/Stack.hpp')
| -rw-r--r-- | include/Stack.hpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/include/Stack.hpp b/include/Stack.hpp new file mode 100644 index 0000000..64bfc66 --- /dev/null +++ b/include/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 + |
