Boost logo

Boost :

Subject: Re: [boost] [Bind] How do I get bind to deduce the return type of for_each?
From: Thomas Jordan (thomasjordan_at_[hidden])
Date: 2010-04-15 15:37:29


> Message: 8
> Date: Thu, 15 Apr 2010 10:51:27 +0100
> From: "Sylvester-Bradley, Gareth"
> <Gareth.Sylvester-Bradley_at_[hidden]>
> To: <boost_at_[hidden]>
> Subject: Re: [boost] [Bind] How do I get bind to deduce the return
> type offor_each?
> Message-ID:
> <84883B934769D3428C4AE2E403B188800A1A0F9A_at_[hidden]>
> Content-Type: text/plain; charset="us-ascii"
>
>> I have been trying to use Boost.bind to create an 'STL algorithm
> function
>> object' to pass into another, 'higher order,' STL algorithm (e.g., to
> pass
>> a for_each into a for_each). However, I am struggling to get bind to
>> deduce the correct return type of the for_each function object.
>
> The following might help:
>
> http://www.boost.org/doc/libs/1_42_0/doc/html/lambda/le_in_details.html#
> lambda.nested_stl_algorithms
>
>
> Best regards,
> Gareth
>
Thanks a lot for the suggestion, I did take a look at Lambda library, and I
saw that it used some extra type information in its STL
algorithm wrappers (the 'sig') to help it figure out the return types.
However, I am against using the Lambda library
for other reasons, I only want to use the bind library. I'd appreciate some
specific advice on how to get the type deduction
with the Boost.bind library. Or is this just not possible with Boost.bind?


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