Boost logo

Boost :

Subject: Re: [boost] decltype and incomplete types
From: Daniel Walker (daniel.j.walker_at_[hidden])
Date: 2010-04-09 17:02:59


On Fri, Apr 9, 2010 at 3:35 PM, Eric Niebler <eric_at_[hidden]> wrote:
>
> On 4/8/2010 4:25 PM, Daniel Walker wrote:
>> On Thu, Apr 8, 2010 at 6:51 PM, Eric Niebler <eric_at_[hidden]> wrote:
>>> On 4/8/2010 3:07 PM, Daniel James wrote:
>>>> This reverts the fixes for:
>>>>
>>>> https://svn.boost.org/trac/boost/ticket/862
>>>
>>> Support for boost.lambda.
>>>
>>> This bug is invalid to begin with. Lambda should be changed to support the
>>> TR1 result_of protocol (which is standard), not the other way around.
>>
>> No, the result_of in this patch can detect the type of any callable
>> object, including those from boost.lambda, in contexts where the type
>> of the call expression is complete. Now, lambda users who would like
>> to query the type of lambda function objects should use their
>> compiler's std::result_of, if it implements any draft of the standard
>> from the past 2 years, or simply roll their own.
>
> Hi Daniel,
>
> IIUC the fix here for Boost.Lambda was to implement the c++0x result_of
> on supporting compilers. That's fine -- as long as you accept that a
> decltype-based result_of is a safe substitute for the TR1 result_of,
> which I don't.

That's fine, but safe is a relative term. Other users might have a
higher tolerance for the risks of being an early adopter. I think
boost can accommodate both sorts of users. If you compile with
-std=c++0x, you already know your moving into a new world, and I think
boost should be there waiting.

>
> My point above was that this bug should have been closed "Invalid"
> because it's not a result_of problem. The problem is that Lambda doesn't
> support the TR1 result_of protocol. <snip>

This is a problem in c++98 and I agree with your solution for c++98
(and the long-term path from Proto to Phoenix to Lambda). But in c++0x
the TR1 result_of protocol is superseded. It just so happens that
fixing the "bug" of boost/lambda compatibility is trivial in c++0x,
even though it's complicated in c++98. This patch fixes the bug in
c++0x.

Daniel Walker


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