Boost logo

Boost Users :

Subject: Re: [Boost-users] Bind
From: Igor R (boost.lists_at_[hidden])
Date: 2009-05-02 14:52:00


> Can boost.bind() be used to delay the call to a member function until you
> have gathered all the data types to populate the function parameter list?

Yes, if you mean something like this:

struct A
{
  voif f(int a, double b, short c);
};

A *a = new A;
function<void(int, double, short)> func = bind(&A::f, a, _1, _2, _3);

// somewhere later:
func(1, 2.0, 0);


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