blob: 57d464f3d93a9f7ce3d90f6770cbd23207d73bd2 (
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();
}
}
|