I have a small problem with lambda expression while using remove_if
on std::vector
I have a following piece of code :
std::remove_if( openList.begin(), openList.end(),
[&](BoardNode& i){
std::cout<< i.getCoordinates() << std::endl;
std::cout<< currentNode.getCoordinates() << std::endl;
return i.getCoordinates() == currentNode.getCoordinates(); }
);
There is no compiler error with this, but the elements which return true from the above statement won't be removed from the vector;
I get printed on the screen e.g.
[5,5]
[5,5]
but the openList
remains as it was.