-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.cpp
50 lines (39 loc) · 891 Bytes
/
Main.cpp
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include <iostream>
#include "mylist.h"
int main()
{
int x = 34;
int &r = x;
MyList<int> testList;
testList.pop_front();
testList.pop_back();
testList.push_back(5);
testList.push_front(32);
testList.push_front(r);
for (auto& i : std::as_const(testList))
{
std::cout << i << " "<< std::endl;
}
for (auto& i : std::as_const(testList))
{
std::cout << i << " " << std::endl;
}
MyList<float> testList2{ 0.1f, 0.3f, 0.145f, 0.56f, 56.f };
for (auto begin = testList2.rbegin(); begin != testList2.rend(); begin++)
{
std::cout << *begin << " ";
}
for (auto& i : testList2)
{
std::cout << i << std::endl;
}
for (auto& i : testList2)
{
i = 0.2f;
}
for (auto& i : testList2)
{
std::cout << i << std::endl;
}
return 0;
}