Website Summary Files Commits Branches @commit @diff @stats
path: root / Sem. 10 / Source.cpp
blob: d8a60366f8665a46a5a49a9dfee2c86201ed09d7 (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
#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();
	}
}