Boost logo

Boost :

From: Eric Niebler (eric_at_[hidden])
Date: 2008-07-02 12:47:34


Joel de Guzman wrote:
> David Abrahams wrote:
>> Joel de Guzman wrote:
>>
>>> Yep. Another feature that makes backward compatibility imperfect.
>>> There's no sense in supporting that feature when Phoenix uses
>>> result_of and BOOST_TYPEOF.
>>
>> Can you explain how Phoenix uses these facilities together?
>
> You should ask Eric. He did that part when he ported it to proto.
> Phoenix used to have its own return type deduction which was
> a very primitive rendition of BOOST_TYPEOF using the sizeof
> trick I hacked a long time ago. Eric switched to result_of
> and BOOST_TYPEOF.

The Phoenix/Proto port in (Phoenix v3) uses BOOST_TYPEOF to deduce the
the type of expressions involving operators, with the exception of the
function call operator. For the function call operator, Phoenix v3 uses
result_of to calculate the return type.

To extend Phoenix v3 with a lazy function, your function object must
conform to the result_of protocol.

Phoenix lambda expressions are themselves function objects and conform
to the result_of protocol.

This is true for the (still immature) Phoenix v3. Phoenix v2 uses its
own protocols.

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com

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