154 lines
4.9 KiB
C++
154 lines
4.9 KiB
C++
|
|
|
|
#define MP_TPL template < typename Key, typename T, typename Compare, typename Alloc >
|
|
#define MP map<Key, T, Compare, Alloc>
|
|
|
|
|
|
namespace ft {
|
|
|
|
|
|
/************
|
|
* copliens :
|
|
************/
|
|
//// constructors ------------------------------
|
|
MP_TPL MP::
|
|
map (const key_compare & comp, const allocator_type & alloc)
|
|
: _allocator(alloc)
|
|
, _comp(comp) {
|
|
|
|
return;
|
|
}
|
|
// template <class InputIterator>
|
|
// map (InputIterator first, InputIterator last,
|
|
// const key_compare& comp = key_compare(),
|
|
// const allocator_type& alloc = allocator_type());
|
|
// map (const map& x);
|
|
//// destructor --------------------------------
|
|
// ~map();
|
|
//// operator= ---------------------------------
|
|
// map& operator= (const map& x);
|
|
|
|
|
|
/*************
|
|
* iterators :
|
|
*************/
|
|
//// begin -------------------------------------
|
|
// iterator begin();
|
|
// const_iterator begin() const;
|
|
//// end ---------------------------------------
|
|
// iterator end();
|
|
// const_iterator end() const;
|
|
//// rbegin ------------------------------------
|
|
// reverse_iterator rbegin();
|
|
// const_reverse_iterator rbegin() const;
|
|
//// rend --------------------------------------
|
|
// reverse_iterator rend();
|
|
// const_reverse_iterator rend() const;
|
|
|
|
|
|
/************
|
|
* capacity :
|
|
************/
|
|
//// empty -------------------------------------
|
|
// bool empty() const;
|
|
//// size --------------------------------------
|
|
// size_type size() const;
|
|
//// max_size ----------------------------------
|
|
// size_type max_size() const;
|
|
|
|
|
|
/******************
|
|
* element access :
|
|
******************/
|
|
//// operator[] --------------------------------
|
|
MP_TPL typename MP::mapped_type& MP::
|
|
operator[] (const key_type& k) {
|
|
|
|
return _bst[k];
|
|
}
|
|
|
|
|
|
/*************
|
|
* modifiers :
|
|
*************/
|
|
//// insert ------------------------------------
|
|
// pair<iterator,bool> insert (const value_type& val);
|
|
// iterator insert (iterator position, const value_type& val);
|
|
// template <class InputIterator>
|
|
// void insert (InputIterator first, InputIterator last);
|
|
//// erase -------------------------------------
|
|
// void erase (iterator position);
|
|
// size_type erase (const key_type& k);
|
|
// void erase (iterator first, iterator last);
|
|
//// swap --------------------------------------
|
|
// void swap (map& x);
|
|
//// clear -------------------------------------
|
|
// void clear();
|
|
|
|
|
|
/*************
|
|
* observers :
|
|
*************/
|
|
//// key_comp ----------------------------------
|
|
// key_compare key_comp() const;
|
|
//// value_comp --------------------------------
|
|
// value_compare value_comp() const;
|
|
|
|
|
|
/**************
|
|
* operations :
|
|
**************/
|
|
//// find --------------------------------------
|
|
// iterator find (const key_type& k);
|
|
// const_iterator find (const key_type& k) const;
|
|
//// count -------------------------------------
|
|
// size_type count (const key_type& k) const;
|
|
//// lower_bound -------------------------------
|
|
// iterator lower_bound (const key_type& k);
|
|
// const_iterator lower_bound (const key_type& k) const;
|
|
//// upper_bound -------------------------------
|
|
// iterator upper_bound (const key_type& k);
|
|
// const_iterator upper_bound (const key_type& k) const;
|
|
//// equal_range -------------------------------
|
|
// pair<const_iterator,const_iterator> equal_range (const key_type& k) const;
|
|
// pair<iterator,iterator> equal_range (const key_type& k);
|
|
|
|
|
|
/*************
|
|
* allocator :
|
|
*************/
|
|
//// get_allocator -----------------------------
|
|
// allocator_type get_allocator() const;
|
|
|
|
|
|
/************************
|
|
* non-member functions :
|
|
************************/
|
|
//// operator == -------------------------------
|
|
//template< class K, class T, class Comp, class Alloc > bool operator==
|
|
// ( const std::map<K,T,Comp,Alloc>& lhs, const std::map<K,T,Comp,Alloc>& rhs );
|
|
//// operator != -------------------------------
|
|
//template< class K, class T, class Comp, class Alloc > bool operator!=
|
|
// ( const std::map<K,T,Comp,Alloc>& lhs, const std::map<K,T,Comp,Alloc>& rhs );
|
|
//// operator < --------------------------------
|
|
//template< class K, class T, class Comp, class Alloc > bool operator<
|
|
// ( const std::map<K,T,Comp,Alloc>& lhs, const std::map<K,T,Comp,Alloc>& rhs );
|
|
//// operator <= -------------------------------
|
|
//template< class K, class T, class Comp, class Alloc > bool operator<=
|
|
// ( const std::map<K,T,Comp,Alloc>& lhs, const std::map<K,T,Comp,Alloc>& rhs );
|
|
//// operator > --------------------------------
|
|
//template< class K, class T, class Comp, class Alloc > bool operator>
|
|
// ( const std::map<K,T,Comp,Alloc>& lhs, const std::map<K,T,Comp,Alloc>& rhs );
|
|
//// operator >= -------------------------------
|
|
//template< class K, class T, class Comp, class Alloc > bool operator>=
|
|
// ( const std::map<K,T,Comp,Alloc>& lhs, const std::map<K,T,Comp,Alloc>& rhs );
|
|
//// swap (map) -----------------------------
|
|
//template< class Key, class T, class Compare, class Alloc > void swap
|
|
// ( std::map<Key,T,Compare,Alloc>& lhs, std::map<Key,T,Compare,Alloc>& rhs );
|
|
|
|
} // namespace ft
|
|
|
|
#undef VT
|
|
#undef VT_TPL
|
|
|