blob: c9fd62e41f48cc46bf09f45d5ad5d2557edcc6b3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#include "vector.hpp"
#include <vector>
#include <iostream>
#include <algorithm>
using namespace ft;
void print(const int& n)
{
std::cout << n << std::endl;
}
int main()
{
vector<int> vec(10);
vector<int> other(vec);
vec = other;
other.assign(vector<int>::size_type(5), 3);
other.push_back(6);
other.push_back(8);
std::for_each(other.begin(), other.end(), print);
std::cout << std::endl;
const vector<int> constvec(other);
std::for_each(constvec.rbegin(), constvec.rend(), print);
std::cout << std::endl;
other.pop_back();
std::for_each(other.begin(), other.end(), print);
std::cout << std::endl;
std::cout << "comparaisons" << std::endl;
std::cout << (vec == other) << std::endl;
std::cout << (vec == other) << std::endl;
return 0;
}
|