Boost logo

Boost Users :

From: Nat Goodspeed (nat_at_[hidden])
Date: 2007-10-02 12:26:00


e r wrote:

> i'm thinking of using something like
>
> some_type* fo = new boost::bind(&A::f,_1);
>
> and use *fo in place of boost::bind(...). is this crazy? what should
> some_type be?

You can use boost::function to store the result of a boost::bind expression:

http://boost.org/libs/bind/bind.html#with_boost_function

For instance, you might write:

boost::function<void(const A&)> bound = boost::bind(&A::f, _1);

depending on the signature of A::f.

Note, don't use 'new', just assign the value of boost::bind.


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