Boost logo

Boost :

From: Joel de Guzman (joel_at_[hidden])
Date: 2008-07-02 18:16:01


Eric Niebler wrote:
> David Abrahams wrote:
>> Eric Niebler wrote:
>>> 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.
>>
>> Interesting. Kinda makes sense, but could you explain the rationale
>> anyway?
>
> You mean, the rationale for using result_of instead of BOOST_TYPEOF for
> the function call operator? BOOST_TYPEOF can't perfectly distinguish
> between lvalues and rvalues.

Yeah, that's my basic problem with BOOST_TYPEOF.

I fudge it where I have to,

Where do you fudge it? if_then expression? How? How about ordinary
operators like a + b? Do you simply not allow weird uses like:

     X& operator+(A a, B b)

return a reference??

Regards,

-- 
Joel de Guzman
http://www.boostpro.com
http://spirit.sf.net

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