friend bool operator?

friend bool operator

Hi, I have a question regarding on using friend bool operator on arduino.

I am try to use friend bool operator on my program.

in C++ this was implemented like this:

friend bool operator<(const Node & a, const Node & b)
{
	    return a.getFValue() > b.getFValue();
}

and also regarding on how to use priority_queue which
has the ability to fetch the element with the highest value first.

Could anyone teach me how to do this in arduino?

It is just the less-than comparison operator.

I am try to use friend bool operator on my program.

Node a;
Node b;

bool result = a < b;

Although your code actually returns the opposite (return a.getFValue() > b.getFValue();).

So how to i exactly do that with thesame return value in

	friend bool operator<(const Node & a, const Node & b)
	{
	    return a.getFValue() > b.getFValue();
	}

So how to i exactly do that with thesame return value in

I can only guess what you’re asking here. The code I posted shows how to use the operator.

Choose whether you want ‘less than’ or ‘grater than’, then stick with it.

iThinkAdmin:
So how to i exactly do that with thesame return value in
friend bool operator<(const Node & a, const Node & b)
{
return a.getFValue() > b.getFValue();
}