Boost logo

Boost Users :

From: Sohail Somani (s.somani_at_[hidden])
Date: 2006-10-02 10:52:54


Sorry for the TP.

Boost bind and boost lambda bind aren't 100% compatible yet. If you are delaying argument evaluation using _[0-9] then I think you *need* to use lambda bind.

-----Original Message-----
From: boost-users-bounces_at_[hidden] on behalf of Jason House
Sent: Sun 10/1/2006 8:52 PM
To: boost-users_at_[hidden]
Subject: Re: [Boost-users] [function] How do you bind twoboost::functionobjects together?
 
Sohail Somani wrote:
>>-----Original Message-----
>>From: boost-users-bounces_at_[hidden]
>>[mailto:boost-users-bounces_at_[hidden]] On Behalf Of Jason House
>>
>>I want the result of the bound expression to have one input parameter
>>that would be decided later. For instance:
>>
>>bool some_function(char x);
>>boost::function<bool (char) some_function_object(some_function);
>>boost::function<bool (int)> f = convert(some_function_object)
>>std::cout << f(32);
>
>
> I think what you're looking for is composition of functions? i.e. g o f
> (x) => g(f(x))?
>
> The right nomenclature might help... What it seems you want to do is to
> generate a function that does this:
>
> bool the_result(int i)
> {
> return some_function(convert_to_char(int));
> }
>
> Is that right?
>
> I know you can curry with boost function + lambda but I haven't tried
> composition myself (though it should be possible!)

Yes, you're right.

It seems that my mistake was possibly that I was using
boost::lambda::bind instead of boost::bind.

_______________________________________________
Boost-users mailing list
Boost-users_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users



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