22 Dec
2014
22 Dec
'14
9:54 p.m.
Hi, I'm probably missing something obvious, but how would I go about making a custom function using a lambda expression? Say I want to declare some function "sqr" which returns "_1 * _1", and then use this in a transform() lambda expression, ie transform(..., 2.0 * sqr(_1) - 3.0 * _1 + 5.0, ...); to evaluate 2x^2 - 3x + 5. If I try to use BOOST_COMPUTE_FUNCTION() I can't use the resulting function in a lambda expression it seems. Cheers - Asbjørn