Boost logo

Boost :

From: Robert Dailey (rcdailey_at_[hidden])
Date: 2008-03-12 18:00:18


On Wed, Mar 12, 2008 at 4:00 PM, Stjepan Rajko <stipe_at_[hidden]> wrote:

> On Wed, Mar 12, 2008 at 1:45 PM, Robert Dailey <rcdailey_at_[hidden]> wrote:
> > 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.
>
> Please see:
>
> http://dancinghacker.com/code/dataflow/dataflow/utility/bind_mem_fn.html

This sounds like exactly what I want. However, I am not able to find out
what header file bind_mem_fn is. I also do not have a 'dataflow' directory
in boost. I'm using boost 1.34.1. Where can I find this? Thanks.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk