-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
56 lines (43 loc) · 1.24 KB
/
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
51
52
53
54
55
56
#include "queue.h"
int main(int argc, char *argv[])
{
queue q = {"we", "are", "waiting", "in", "the", "queue"};
std::cout << q << "\n";
while (q.size() > 3)
{
auto s = q.peek();
std::cout << s << "\n";
q.pop();
}
queue andtheygo =
{"et", "eunt", "homines", "mirari", "alta", "montium",
"et", "ingentes", "fluctus", "maris", "et", "latissimos", "lapsus",
"fluminum", "et", "Oceani", "ambitum", "et", "gyros", "siderum",
"et", "relinquunt", "se", "ipsos", "nec", "mirantur"};
q = andtheygo;
while (q.size())
{
std::cout << q.peek() << "\n";
q.pop();
}
queue j = {"can", "you", "see", "me?"};
std::cout << "queue j: " << j << "\n";
std::cout << "the size of the queue j is " << j.size() << "\n";
if (j.empty())
{
std::cout << "queue j is empty"
<< "\n";
}
else
{
std::cout << "queue j is not empty"
<< "\n";
}
j.reset(3);
std::cout << "after resetting queue j to 3: " << j << "\n";
queue f(j);
std::cout << "queue f is a copy of j: " << f << "\n";
j.clear();
std::cout << "after clearing queue j: " << j << "\n";
return 0;
}