Ticket #13087: main.cpp

File main.cpp, 581 bytes (added by jun.kudo@…, 5 years ago)

Complete example of encountered error

Line 
1#include "boost/heap/binomial_heap.hpp"
2typedef boost::heap::binomial_heap<int> Heap;
3
4int main(int argc, char* argv[]) {
5 Heap heap0;
6 size_t heap0_size = 13;
7 size_t max_range = 100;
8 for (size_t ix = 0; ix < heap0_size; ++ix) {
9 heap0.push(rand() % max_range);
10 }
11
12 Heap heap1;
13 size_t heap1_size = 5;
14 for (size_t ix = 0; ix < heap1_size; ++ix) {
15 heap1.push(rand() % max_range);
16 }
17 heap0.merge(heap1);
18
19 Heap heap2;
20 size_t heap2_size = 1;
21 for (size_t ix = 0; ix < heap2_size; ++ix) {
22 heap2.push(rand() % max_range);
23 }
24 heap2.merge(heap0);
25
26}