summaryrefslogtreecommitdiff
path: root/main.cpp
blob: e0e97c3876b54ad641b0d9b0683e2c5e9a4602ae (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
34
#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::for_each(constvec.begin(), constvec.end(), print);
	std::cout << std::endl;
	other.pop_back();
	std::for_each(other.rbegin(), other.rend(), print);
	std::cout << std::endl;
	std::cout << "comparaisons" << std::endl;
	std::cout << (vec == other) << std::endl;
	std::cout << (vec == other) << std::endl;
	return 0;
}