Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2004-06-26 12:44:54


"Nico Massi" <desertswat_at_[hidden]> writes:

> Hi,
>
> Is it possible to store a boost::bind?

No; boost::bind is a function template.

> boost::bind<int> x( f, _1, _2 );
> int i = x( 3, 4 );
>
> I get errors if i want to declare a variable of type boost::bind.
> The point is:
>
> I want to have an object that gets a boost::bind, stores it and
> executes it with
> the correct values to the time i want.
> How can i do this?

Maybe you want

      boost::function<int(int,int)> x = boost::bind(f,_1,_2);

??

-- 
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com

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