-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathList.cpp
More file actions
45 lines (38 loc) · 852 Bytes
/
List.cpp
File metadata and controls
45 lines (38 loc) · 852 Bytes
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
#include "List.h"
#include <iostream>
int main()
{
List<int> lst;
for (int i = 0; i < 10; ++i)
{
lst.push_back(i);
}
for (const auto &it : lst)
{
std::cout << it << std::endl;
}
// for (auto it = lst.begin(); it != lst.end(); ++it)
// {
// std::cout << *it << std::endl;
// }
// List<int> lst = {1, 2, 3, 4, 5};
// for (auto &x : lst)
// {
// std::cout << x << "\t";
// }
// std::cout << std::endl;
// // List<int> lst2 = std::move(lst);
// List<int> lst2 = List<int> {5, 6};
// for (auto &x : lst2)
// {
// std::cout << x << "\t";
// }
// std::cout << std::endl;
// lst2 = std::move(lst);
// for (auto &x : lst2)
// {
// std::cout << x << "\t";
// }
// std::cout << std::endl;
return 0;
}