-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathqueue.cpp
More file actions
52 lines (48 loc) · 1.17 KB
/
Copy pathqueue.cpp
File metadata and controls
52 lines (48 loc) · 1.17 KB
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
// Copyright (c) 2024- David Lucius Severus
//
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
#include "snowball/snowball.hpp"
#include "../src/io/console.hpp"
#include "../src/queue.hpp"
#include "../src/std.hpp"
int
main()
{
sb::verify_debug();
enable_scope()
{
micron::spsc_queue<int, 64> qu;
for ( int i = 0; i < 50; i++ ) qu.push(i);
while ( !qu.empty() ) {
mc::console("Back: ", qu.front());
qu.pop();
}
qu.clear();
for ( int i = 20; i < 140; i++ ) qu.push(i);
mc::console(qu.front());
};
disable_scope()
{
micron::queue<int> qu;
for ( int i = 3; i < 10; i++ ) qu.push(i);
while ( !qu.empty() ) {
mc::console("Front: ", qu.front());
mc::console("Back: ", qu.last());
qu.pop();
}
};
disable_scope()
{
micron::queue<int> qu;
for ( int i = 0; i < 50; i++ ) qu.push(i);
qu.reserve(65536);
for ( int i = 50; i < 60; i++ ) qu.push(i);
while ( !qu.empty() ) {
mc::console("Front: ", qu.front());
mc::console("Back: ", qu.last());
qu.pop();
}
};
}