| 1 |
|
| 2 |
#include "cirque.h" |
| 3 |
#include <iostream> |
| 4 |
#include <string> |
| 5 |
using namespace std; |
| 6 |
|
| 7 |
int main() |
| 8 |
{ |
| 9 |
CirQue<string> ci(4); |
| 10 |
ci.push_back("1"); |
| 11 |
ci.push_back("2"); |
| 12 |
cout << ci.size() << ' ' << ci.front() << ' ' << ci.back() << '\n'; |
| 13 |
|
| 14 |
ci.push_back("3"); |
| 15 |
ci.pop_front(); |
| 16 |
ci.push_back("4"); |
| 17 |
ci.pop_front(); |
| 18 |
ci.push_back("5"); |
| 19 |
cout << ci.size() << ' ' << ci.front() << ' ' << ci.back() << '\n'; |
| 20 |
|
| 21 |
CirQue<string> copy(ci); |
| 22 |
copy.pop_front(); |
| 23 |
cout << copy.size() << ' ' << copy.front() << ' ' << copy.back() << '\n'; |
| 24 |
|
| 25 |
int arr[] = {1, 3, 5, 7, 9}; |
| 26 |
CirQue<int> ca(arr); |
| 27 |
cout << ca.size() << ' ' << ca.front() << ' ' << ca.back() << '\n'; |
| 28 |
|
| 29 |
// int *ap = arr; |
| 30 |
// CirQue<int> cap(ap); |
| 31 |
} |