I am working with some legacy code for a school project and am trying to capture if std::bind fails. This is the code currently in the project (not written by me) that is producing "C++ no operator matches these operands" error in VS 2019. I've tried comparing against a bool which is what it says std::bind returns to no avail.
if ( bind( socket, (const sockaddr*) &address, sizeof(sockaddr_in) ) < 0 )
{
printf( "failed to bind socket\n" );
Close();
return false;
}
How else can I properly capture if std::bind fails within an if statement?