Ticket #8195: testpq.cpp

File testpq.cpp, 533 bytes (added by rob.patro@…, 10 years ago)

file reproduces bug with heap emplace operation.

Line 
1#include <boost/heap/skew_heap.hpp>
2#include <vector>
3#include <iostream>
4
5class thing {
6public:
7 thing( int a_, int b_, int c_ ) : a(a_), b(b_), c(c_) {}
8public:
9 int a;
10 int b;
11 int c;
12};
13
14class cmpthings {
15public:
16 bool operator() ( const thing& lhs, const thing& rhs ) const {
17 return lhs.a > rhs.a;
18 }
19 bool operator() ( const thing& lhs, const thing& rhs ) {
20 return lhs.a > rhs.a;
21 }
22};
23
24int main(){
25
26 cmpthings ord;
27 boost::heap::skew_heap<thing, boost::heap::compare<cmpthings>> vpq(ord);
28 vpq.emplace(5,6,7);
29}