On 6/3/10 6:11 PM, alfC wrote:
I have and expression of type
arg1*arg1
which is contained in a deduced type LambdaExp (more preciselly composite
, argument<0> >) when trying to see what is the phoenix-deduced return type when input is double
typename LambdaExp::template result
::type naturally, it gives 'double' (double*double)
but when the input type is a boost::units::quantity
typename LambdaExp::template result
si::length > >::type it gives:
error_cant_deduce_type (instread of the equivalent of quantitysi::area, like in quantitysi::area a = quantitysi::length()*quantitysi::length() )
this is strange since it seemed that Phoenix worked out of the box with Units.
What is going on? How can we help Phoenix deduce the return type? Does Phoenix need this help, like Boost.Lambda does by means of boost/ units/lambda.hpp?
Could you please post a minimal cpp file for this one too? You are right, it should work out of the box. Not sure, but it might be a bug. Phoenix2 type deduction, while better than Lambda, is still unwieldy. This will all be fixed in 3.0. Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net