correct map insert to use _comp, add tests iterators in swap, and add correction screenshot

This commit is contained in:
Hugo LAMY
2022-07-05 21:22:34 +02:00
parent ca066489a7
commit 81b76ae040
3 changed files with 15 additions and 4 deletions

View File

@@ -639,8 +639,19 @@ TEST_V(tests_vector_swap)
ft::vector<T> foo (3,VAL(100)); // three ints with a value of 100
ft::vector<T> bar (5,VAL(200)); // five ints with a value of 200
typename ft::vector<T>::iterator it1 = foo.begin();
typename ft::vector<T>::iterator it2 = bar.begin();
std::cout << "it1:" << *it1 << " - it2:" << *it2 << "\n";
std::cout << "foo.begin():" << *(foo.begin()) << " - bar.begin():" << *(bar.begin()) << "\n";
foo.swap(bar);
std::cout << "swap\n";
std::cout << "it1:" << *it1 << " - it2:" << *it2 << "\n";
std::cout << "foo.begin():" << *(foo.begin()) << " - bar.begin():" << *(bar.begin()) << "\n";
PRINT(foo)
PRINT(bar)