
Allen Zhao wrote:
With regard to the boost:bind problem, I am not sure what happened. BTW, anyone knows the equalivalent form for the following nested bind:
struct peer { enum connection_type { not_connectable,connectable };
peer(const address& ip, connection_type t); ... peer_connection* connection; };
std::vector<peer> m_peers; peer_connection& c;
assert(std::find_if(m_peers.begin(), m_peers.end() , boost::bind(std::equal_to
(),
Try
boost::bind<bool>( std::equal_to
boost::bind(&peer::connection, _1) , &c)) != m_peers.end());
or possibly boost::bind( &peer::connection, _1 ) == &c
I am trying to invoke the predicate std:equal_to() directly, therefore remove the first boost::bind()..