Website Summary Files Commits Branches @commit @diff @stats
path: root / Sem. 10 / Source2.cpp
blob: 7e112039087cc6d3af46c18ae5743918e21e640b (plain) (blame)
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 <iostream>
#include "MyString/MyString.h"
#include "Queue.hpp"
int main()
{
	{
		MyQueue<size_t> q;

		q.push(3);
		q.push(10);

		std::cout << q.peek() << std::endl;
		q.pop();

		std::cout << q.peek() << std::endl;
		q.pop();

	}
	{
		MyQueue<MyString> q;

		MyString name = "Ivan";

		q.push(std::move(name)); //so it could call push(MyString&&)

		MyString name2 = "Petur";
		q.push(name2); //push(const MyString&)

		q.push("Alex");//push(MyString&&)

		std::cout << q.peek() << std::endl;
		q.pop();

		std::cout << q.peek() << std::endl;
		q.pop();

		std::cout << q.peek() << std::endl;
		q.pop();
	}
}
//copy constr
// destr
//destr
//destr
//destr