map pair ok

This commit is contained in:
hugogogo
2022-06-20 15:40:35 +02:00
parent 8a404b0839
commit 8c181b6407
7 changed files with 287 additions and 67 deletions

View File

@@ -1,9 +1,7 @@
//#define VT_TPL template <class T, class Allocator>
//#define VT vector<T, Allocator>
//#define MP_TPL template < typename Key, typename T, typename Compare, typename Allocator >
//#define MP map<Key, T, Compare, Allocator>
#define MP_TPL template < typename Key, typename T, typename Compare, typename Alloc >
#define MP map<Key, T, Compare, Alloc>
namespace ft {
@@ -13,8 +11,13 @@ namespace ft {
* copliens :
************/
//// constructors ------------------------------
// explicit map (const key_compare& comp = key_compare(),
// const allocator_type& alloc = allocator_type());
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(),
@@ -113,8 +116,34 @@ namespace ft {
//// 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
#undef VT
#undef VT_TPL