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 /List.hpp | |
| 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 'List.hpp')
| -rw-r--r-- | List.hpp | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/List.hpp b/List.hpp new file mode 100644 index 0000000..57a9a8f --- /dev/null +++ b/List.hpp @@ -0,0 +1,95 @@ +#ifndef LIST_HPP +# define LIST_HPP + +namespace ft +{ + template < class T, class Alloc = allocator<T> > + class List + { + public: + List(const allocator_type& alloc = allocator_type()); + // List(size_type n, const value_type& val = value_type(), const allocator_type& alloc = allocator_type()); + // template <class InputIterator> + // List(InputIterator first, InputIterator last, const allocator_type& alloc = allocator_type()); + // List(const list& x); + ~List(); + // List& operator = (const List& x); + + // iterators + // iterator begin(); + // const_iterator begin() const; + // iterator end(); + // const_iterator end() const; + // reverse_iterator rbegin(); + // const_reverse_iterator rbegin() const; + // reverse_iterator rend(); + // const_reverse_iterator rend() const; + + // capacity + bool empty() const; + size_type size() const; + size_type max_size() const; + + // element access + reference front(); + const_reference front() const; + reference back(); + const_reference back(); + + // modifiers + // template <class InputIterator> + // void assign (InputIterator first, InputIterator last); + // void assign (size_type n, const value_type& val); + void push_front (const value_type& val); + void pop_front(); + void push_back (const value_type& val); + void pop_back(); + // iterator insert (iterator position, const value_type& val); + // void insert (iterator position, size_type n, const value_type& val); + // template <class InputIterator> + // void insert (iterator position, InputIterator first, InputIterator last); + // iterator erase (iterator position); + // iterator erase (iterator first, iterator last); + // void swap (list& x); + // void resize (size_type n, value_type val = value_type()); + // void clear(); + + // operations + // void splice (iterator position, list& x); + // void splice (iterator position, list& x, iterator i); + // void splice (iterator position, list& x, iterator first, iterator last); + // void remove (const value_type& val); + // template <class Predicate> + // void remove_if (Predicate pred); + // void unique(); + // template <class BinaryPredicate> + // void unique (BinaryPredicate binary_pred); + // + // void merge (list& x); + // template <class Compare> + // void merge (list& x, Compare comp); + // void sort(); + // template <class Compare> + // void sort (Compare comp); + // void reverse(); + + // observers + // allocator_type get_allocator() const; + + private: + class PrivateList + { + public: + PrivateList(const value_type& val); + ~PrivateList(); + + PrivateList *next; + T val; + } + PrivateList *front; + PrivateList *back; + size_type size; + }; +} + +#endif |
