| 1 | module main |
| 2 | |
| 3 | import datatypes |
| 4 | |
| 5 | struct Item { |
| 6 | priority int |
| 7 | } |
| 8 | |
| 9 | // Issue https://github.com/vlang/v/issues/13318 |
| 10 | |
| 11 | /* |
| 12 | fn (a Item) < (b Item) bool { |
| 13 | return a.priority < b.priority |
| 14 | } |
| 15 | |
| 16 | fn (a Item) == (b Item) bool { |
| 17 | return a.priority == b.priority |
| 18 | } |
| 19 | */ |
| 20 | |
| 21 | fn main() { |
| 22 | min_heap() |
| 23 | } |
| 24 | |
| 25 | fn min_heap() { |
| 26 | mut heap := datatypes.MinHeap[Item]{} |
| 27 | |
| 28 | heap.insert(Item{10}) |
| 29 | |
| 30 | println(heap) |
| 31 | } |
| 32 |