Boost Users :
From: Duane Murphy (duanemurphy_at_[hidden])
Date: 2005-01-27 22:48:53
--- At Thu, 27 Jan 2005 18:31:22 -0700, Jonathan Turkanis wrote:
>Duane Murphy wrote:
>> How do I work around this problem with bind?
>> #include <boost/bind.hpp>
>> class functions
>> int func( int );
>> int func( int, int );
>> void test()
>> functions a_func;
>> functions::func, a_func, 1, _1 );
>This looks like it should work (after adding an ampersand in front of
>functions::func) .... Works of VC7.1 and GCC 3.4.2.
>> As I recall there was some way of helping bind to pick one of the
>> overloaded functions using a typedef or something similar. (Maybe that
>> was function?).
>See this thread.
>This message has an example almost the same as yours:
Thanks! That's what I needed to give me the solution.
int func( int ) const;
void test() const;
int func( int, int ) const;
void functions::test() const
int (functions::* func_1)( int, int ) const
boost::bind( func_1, *this, 1, _1 );
This is a much more like what I was battling.
(Thanks for reminding me about the list archives as well.)
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