34 lines
753 B
C++
34 lines
753 B
C++
#ifndef TESTS_MAP_HPP
|
|
# define TESTS_MAP_HPP
|
|
|
|
#include "tests_utils.hpp"
|
|
|
|
|
|
// toogle between test ft and stl
|
|
// *************************
|
|
#ifdef STL
|
|
namespace ft = std;
|
|
#else
|
|
#include "map.hpp"
|
|
#include "reverse_iterator.hpp"
|
|
#endif
|
|
|
|
|
|
// templates print
|
|
// *****************************************
|
|
template <class T, class U>
|
|
void print(ft::map<T, U>& mp, std::string name) {
|
|
|
|
int i = 0;
|
|
typename ft::map<T, U>::iterator it;
|
|
typename ft::map<T, U>::iterator it_end = mp.end();
|
|
|
|
std::cout << "\n" << name << ":(map)\n";
|
|
for (it = mp.begin(); it != it_end; ++it, i++)
|
|
std::cout << "[" << i << "]" << it->first << ":" << it->second << " ";
|
|
std::cout << "\nsize:" << mp.size() << "\n";
|
|
}
|
|
|
|
#endif
|
|
|