diff --git a/containers/map.hpp b/containers/map.hpp index 02f7f41..1d31c89 100644 --- a/containers/map.hpp +++ b/containers/map.hpp @@ -6,11 +6,285 @@ /* By: apommier +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/10/12 19:46:25 by apommier #+# #+# */ -/* Updated: 2022/10/18 10:17:57 by apommier ### ########.fr */ +/* Updated: 2022/11/17 07:41:22 by apommier ### ########.fr */ /* */ /* ************************************************************************** */ #ifndef MAP_HPP # define MAP_HPP +namespace ft +{ + +template< + class Key, + class T, + class Compare = std::less, + class Allocator = std::allocator>> + +class map +{ + public : + + //----------------------------- + //---------MEMBER TYPE--------- + //----------------------------- + + typedef Key key_type; + typedef T mapped_type; + typedef std::pair value_type; + typedef std::size_t size_type; + typedef std::ptrdiff_t difference_type; + typedef Compare key_compare; + typedef Allocator allocator_type; + typedef value_type& reference; + typedef const value_type& const_reference; + typedef Allocator::pointer pointer; + typedef Allocator::const_pointer const_pointer; + typedef LegacyBidirectionalIterator iterator; + typedef LegacyBidirectionalIterator const_iterator; + typedef std::reverse_iterator reverse_iterator; + typedef std::reverse_iterator const_reverse_iterator; + + //----------------------------- + //-----PRIVATE MEMBER TYPE----- + //----------------------------- + private : + + pointer _start; + + public : + + //--------------------------------------- + //---------COPLIEN FORM FUNCTION--------- + //--------------------------------------- + map(); + explicit map( const Compare& comp, const Allocator& alloc = Allocator() ) + { + + } + + + template< class InputIt > + map( InputIt first, InputIt last, const Compare& comp = Compare(), const Allocator& alloc = Allocator() ) + { + + } + + + map( const map& x) + { + + } + + ~map() + { + + } + + + map& operator=( const map& x ) + { + + } + + + //---------------------------------- + //---------MEMBER FUNCTION---------- + //---------------------------------- + + //------------------------- + //--------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-------- + //------------------------------ + mapped_type& operator[] (const key_type& k) + { + + } + + mapped_type& at (const key_type& k) + { + + } + + const mapped_type& at (const key_type& k) const + { + + } + + + //------------------------- + //--------Modifiers-------- + //------------------------- + pair insert (const value_type& val) + { + + } + + iterator insert (iterator position, const value_type& val) + { + + } + + template void insert (InputIterator first, InputIterator last) + { + + } + + void erase (iterator position) + { + + } + + size_type erase (const key_type& k) + { + + } + + void erase (iterator first, iterator last) + { + + } + + void swap (map& x) + { + + } + + void clear() + { + + } + + + //------------------------- + //--------Observers-------- + //------------------------- + key_compare key_comp() const + { + + } + + value_compare value_comp() const + { + + } + + + //------------------------- + //-------Operations-------- + //------------------------- + + iterator find (const key_type& k) + { + + } + + const_iterator find (const key_type& k) const + { + + } + + size_type count (const key_type& k) const + { + + } + + iterator lower_bound (const key_type& k) + { + + } + + const_iterator lower_bound (const key_type& k) const + { + + } + + iterator upper_bound (const key_type& k) + { + + } + + const_iterator upper_bound (const key_type& k) const + { + + } + + pair equal_range (const key_type& k) const + { + + } + + pair equal_range (const key_type& k) + { + + } + + +}; + +} + #endif \ No newline at end of file diff --git a/containers/vector.hpp b/containers/vector.hpp index 4cbd29c..ba4f6aa 100644 --- a/containers/vector.hpp +++ b/containers/vector.hpp @@ -6,7 +6,7 @@ /* By: apommier +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/10/12 19:46:32 by apommier #+# #+# */ -/* Updated: 2022/11/16 22:42:51 by apommier ### ########.fr */ +/* Updated: 2022/11/17 06:53:12 by apommier ### ########.fr */ /* */ /* ************************************************************************** */ @@ -40,7 +40,7 @@ class vector typedef const ft::random_access_iterator const_iterator; typedef std::reverse_iterator reverse_iterator; typedef std::reverse_iterator const_reverse_iterator; - typedef ptrdiff_t difference_type; + typedef std::ptrdiff_t difference_type; typedef std::size_t size_type;