diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-01-31 12:46:19 +0100 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-01-31 12:46:19 +0100 |
| commit | 46b9e6f61275c4ed4cd2e8f319cad4f6bc73100f (patch) | |
| tree | c33522b5337b0214154232870eaa830b3f0e4108 /Stack.htpp | |
| parent | f89b202792c118a0baa5fb7f4978dbc2077b64d4 (diff) | |
| download | ft_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.htpp | 29 |
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 + |
