So I have inherited some code and while updating it to C++17 I receive the error message:
error C2039: 'binary_function': is not a member of 'std'
The binary_function is used in two places. Fortunately both code segments seem to be very similar
struct CompareNodes : public std::binary_function<double, double, bool>
{
bool operator()(BOARD_NODE_STRUCT *pNS1, BOARD_NODE_STRUCT *pNS2)
{
return (*pNS1) < (*pNS2);
}
};
struct CompareNodes : public std::binary_function<NODE_STRUCT *, NODE_STRUCT *, bool>
{
bool operator()(NODE_STRUCT *pNS1, NODE_STRUCT *pNS2)
{
return (pNS1->name.CompareNoCase(pNS2->name) < 0);
}
};
I guess that I'm still a bit of a novice because I have not seen code like this before. How do I update this code to something that is equivalent?