Here's an example of how to use binary_search :
bool Compare( const Client& lhs, const Client& rhs )
{
return ( lhs.client_id < rhs.client_id );
}
bool DoesClientExist( const Client &client, std::vector <Client> clientVec )
{
return binary_search( clientVec.begin(), clientVec.end(), client, Compare );
}