blob: 0f91611cafa3fc9b79468db137fcc0ab443c0c5f (
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.rbegin(), other.rend());
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;
}
|