
12 Mar
2008
12 Mar
'08
8:45 p.m.
Hi, I wish to use boost::bind to simply wrap a member function pointer. I'm passing a member function into a slot in the Boost.Signals library, and I would like the convenience of not having to specify the number of arguments each member function has in boost.bind. For example, assume I have the following class: class Foo { public: void Function1( int ) {} void Function2( int, int, bool ) {} }; I would like to be able to do the following: Foo myFoo; boost::bind( &Foo::Function1, myFoo ); In the case above, I now have an object bound to my function pointer, however I am required to explicitly place a _1, _2, _3 (etc) depending on how many parameters the member function takes. Is there a way that this can be automated? Thanks.