Boost logo

Boost Users :

From: Javier Estrada (JEstrada_at_[hidden])
Date: 2006-12-05 16:20:28


Excellent. Thx. I knew it was somewhere in the documentation (Boost
1.33) but I could not get my hands around it ;-)

-----Original Message-----
From: boost-users-bounces_at_[hidden]
[mailto:boost-users-bounces_at_[hidden]] On Behalf Of Sebastian Redl
Sent: Tuesday, December 05, 2006 1:20 PM
To: boost-users_at_[hidden]
Subject: Re: [Boost-users] Binding to an overloaded member function

Javier Estrada wrote:
> How can I use boost bind to bind to an overloaded member function?
>
You have to cast explicitly to select the correct overload.
> But when I added:
>
> void C::dial(char key, MyConstants c); void C::dial(string toDial);
> void C::dial(string, MyConstants c);
>
> References to my working code break:
>
> for_each(begin, end, boost::bind(&C::dial, this, _1 ));
>
for_each(begin, end, boost::bind(
    static_cast<void (C::*)(char)>(&C::dial), this, _1));

Sebastian Redl
_______________________________________________
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