I am trying to fix my program, but i keep getting the error in the title. This is the entire error.
Severity Code Description Project File Line Suppression State
Error C2678 binary '<': no operator found which takes a left-hand operand of type 'const node' (or there is no acceptable conversion) basicgraph c:\program files (x86)\microsoft visual studio 14.0\vc\include\xstddef 239
My code is kind of long so i put it into a paste bin. I think the problem is happening is within the dijkstraBFS function. Specifically with my priority_queue<node> queue. I read something that said I needed to overload < within the struct, but I was unable to get it working. Any help would be greatly appreciated.
struct node
{
int index = 0 ;
int value = 0 ;
int bestValue = 0 ;
booloperator < ( const node& rhs ) const // must be const-correct
{
// return true if, in a sorted sequence, the node *this should appear before the node rhs
// for example:
returnthis->value < rhs.value ; // ordered on ascending value
}
};