-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathstack.cpp
More file actions
53 lines (50 loc) · 1.41 KB
/
Copy pathstack.cpp
File metadata and controls
53 lines (50 loc) · 1.41 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
53
// 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 <iostream>
#include "../src/io/console.hpp"
#include "../src/range.hpp"
#include "../src/stack.hpp"
#include "../src/std.hpp"
#include <stack>
int
main()
{
if constexpr ( true ) {
mc::stack<int> stck{ 2, 6, 7, 22, 55 };
mc::console(stck.max_size());
for ( int i = 0; i < 100; i++ ) stck.push(i);
mc::console(stck.size());
mc::console(stck.top());
stck.pop();
mc::console(stck.top());
}
if constexpr ( false ) {
mc::istack<int> stck{ 2, 6, 7, 22, 55 };
mc::console(stck.max_size());
for ( int i = 0; i < 100; i++ ) stck.push(i);
mc::console(stck.size());
mc::console(stck.top());
}
if constexpr ( false ) {
mc::stack<int> stck{ 2, 6, 7, 22, 55 };
using rng = mc::int_range<0, 1e7>;
rng::perform(stck, static_cast<void (mc::stack<int>::*)(const int &)>(&mc::stack<int>::push));
mc::console(stck.size());
mc::console(stck.top());
}
if constexpr ( false ) {
mc::stack<int> stck{ 2, 6, 7, 22, 55 };
mc::istack<int> istck(stck);
mc::console(istck.size());
mc::console(istck.top());
}
if constexpr ( false ) {
mc::sstack<int> stck{ 2, 6, 7, 22, 55 };
mc::console(stck.size());
mc::console(stck.top());
}
return 1;
}