Boost logo

Boost Users :

From: Allen Zhao (xlz_at_[hidden])
Date: 2006-01-04 19:27:56


Thank you so much, Peter.

Both suggested fixes works! Add a return type also resolves several
other errors as well.

Best regards,

Allen Zhao

Peter Dimov wrote:

>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<peer_connection*>(),
>>
>>
>
>Try
>
> boost::bind<bool>( std::equal_to<peer_connection*>(),
>
>
>
>> 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()..
>>
>>
>
>_______________________________________________
>Boost-users mailing list
>Boost-users_at_[hidden]
>http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
>
>
>



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net