[lambda & range] bind for transformed - how to do it.
In this code (fabricated) sequence, ages_by_bind compiles, but
ages_by_lambda
does not.
I believe this is because the lambda version does not publish result_type
to its
resultant functors, since the increased generality of lambda makes this
difficult
or impossible to do.
Is there any way I can get round this, as it currently makes the
lambda/transformed
combination completely unusable AFAICS.
Thx,
- Rob.
#include <map>
#include <vector>
#include <string>
#include
On 29 November 2011 13:09, Robert Jones
In this code (fabricated) sequence, ages_by_bind compiles, but ages_by_lambda does not.
I believe this is because the lambda version does not publish result_type to its resultant functors, since the increased generality of lambda makes this difficult or impossible to do.
Is there any way I can get round this, as it currently makes the lambda/transformed combination completely unusable AFAICS.
Have you tried using Phoenix? It has better support for result_type.
On Tue, Nov 29, 2011 at 1:30 PM, Daniel James
On 29 November 2011 13:09, Robert Jones
wrote: In this code (fabricated) sequence, ages_by_bind compiles, but ages_by_lambda does not.
I believe this is because the lambda version does not publish result_type to its resultant functors, since the increased generality of lambda makes this difficult or impossible to do.
Is there any way I can get round this, as it currently makes the lambda/transformed combination completely unusable AFAICS.
Have you tried using Phoenix? It has better support for result_type.
I have now, precisely because I'd understood it had better support as you
said. Like this,
perhaps someone could tell me if this is fine on 1.44/1.47 too!
Thx,
- Rob.
#include
Robert Jones wrote:
I believe this is because the lambda version does not publish result_type to its resultant functors, since the increased generality of lambda makes this difficult or impossible to do.
What version of Boost do you use? Boost.Lambda has supported result_of since Boost 1.44. Your code compiles fine with the trunk version of Boost. Regards, Michel
On Tue, Nov 29, 2011 at 1:43 PM, Michel Morin
Robert Jones wrote:
I believe this is because the lambda version does not publish result_type to its resultant functors, since the increased generality of lambda makes this difficult or impossible to do.
What version of Boost do you use? Boost.Lambda has supported result_of since Boost 1.44.
Your code compiles fine with the trunk version of Boost.
:( 1.41, piffle!
Thx for the info tho'. - Rob.
On 29.11.2011 17:09, Robert Jones wrote:
In this code (fabricated) sequence, ages_by_bind compiles, but ages_by_lambda does not.
I believe this is because the lambda version does not publish result_type to its resultant functors, since the increased generality of lambda makes this difficult or impossible to do.
Is there any way I can get round this, as it currently makes the lambda/transformed combination completely unusable AFAICS. Visual Studio 2010 SP1 (with boost from trunk) compiles this code. I suppose 1.48 will be ok too. BTW, why using bind or even lambda? There is a more simpler way:
#include
participants (4)
-
Daniel James
-
Michel Morin
-
Robert Jones
-
Sam Fisher