I have a problem with a part of my binary heap i am building for my a* (pathfinding) project.
The program crashes on this line with debug assertion failed message, expression: (_BLOCK_TYPE_IS_VALID(pHead->nBlockUse)):

Comparable temp = theHeapsArray[hole];

I have tried creating my heap with integers and it worked.

But when i try to create a BinaryHeap<HeapEntry> it fails on that (see code) line.
I have overloaded operator<() and operator>() in my "HeapEntry" struct. Do i have to do something else with it to be able to assign a comparable variable as a HeapEntry?

Tell me if u want more code.

Would appreciate any help as i just started programming in c++ a few weeks ago.

5 Years
Discussion Span
Last Post by toimelin

I think the problem was that HeapEntry contained a pointer that i deleted in HeapEntries destructor. When the Comparable temp went out of scope it got deleted unintentionally, or something like that.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.