| 1 | #include <boost/heap/skew_heap.hpp>
|
|---|
| 2 | #include <vector>
|
|---|
| 3 | #include <iostream>
|
|---|
| 4 |
|
|---|
| 5 | class thing {
|
|---|
| 6 | public:
|
|---|
| 7 | thing( int a_, int b_, int c_ ) : a(a_), b(b_), c(c_) {}
|
|---|
| 8 | public:
|
|---|
| 9 | int a;
|
|---|
| 10 | int b;
|
|---|
| 11 | int c;
|
|---|
| 12 | };
|
|---|
| 13 |
|
|---|
| 14 | class cmpthings {
|
|---|
| 15 | public:
|
|---|
| 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 |
|
|---|
| 24 | int main(){
|
|---|
| 25 |
|
|---|
| 26 | cmpthings ord;
|
|---|
| 27 | boost::heap::skew_heap<thing, boost::heap::compare<cmpthings>> vpq(ord);
|
|---|
| 28 | vpq.emplace(5,6,7);
|
|---|
| 29 | }
|
|---|